mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-21 23:08:07 +00:00
Merge branch 'main' into rotation-behaviors
This commit is contained in:
@@ -35,25 +35,21 @@
|
||||
void ControlBehaviors::RequestUpdatedID(ControlBehaviorContext& context) {
|
||||
BehaviorMessageBase msgBase{ context.arguments };
|
||||
const auto oldBehaviorID = msgBase.GetBehaviorId();
|
||||
ObjectIDManager::RequestPersistentID(
|
||||
[context, oldBehaviorID](uint32_t persistentId) {
|
||||
if (!context) {
|
||||
LOG("Model to update behavior ID for is null. Cannot update ID.");
|
||||
return;
|
||||
}
|
||||
LWOOBJID persistentIdBig = persistentId;
|
||||
GeneralUtils::SetBit(persistentIdBig, eObjectBits::CHARACTER);
|
||||
// This updates the behavior ID of the behavior should this be a new behavior
|
||||
AMFArrayValue args;
|
||||
if (!context) {
|
||||
LOG("Model to update behavior ID for is null. Cannot update ID.");
|
||||
return;
|
||||
}
|
||||
LWOOBJID persistentIdBig = ObjectIDManager::GetPersistentID();
|
||||
// This updates the behavior ID of the behavior should this be a new behavior
|
||||
AMFArrayValue args;
|
||||
|
||||
args.Insert("behaviorID", std::to_string(persistentIdBig));
|
||||
args.Insert("objectID", std::to_string(context.modelComponent->GetParent()->GetObjectID()));
|
||||
args.Insert("behaviorID", std::to_string(persistentIdBig));
|
||||
args.Insert("objectID", std::to_string(context.modelComponent->GetParent()->GetObjectID()));
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(context.modelOwner, context.modelOwner->GetSystemAddress(), "UpdateBehaviorID", args);
|
||||
context.modelComponent->UpdatePendingBehaviorId(persistentIdBig, oldBehaviorID);
|
||||
GameMessages::SendUIMessageServerToSingleClient(context.modelOwner, context.modelOwner->GetSystemAddress(), "UpdateBehaviorID", args);
|
||||
context.modelComponent->UpdatePendingBehaviorId(persistentIdBig, oldBehaviorID);
|
||||
|
||||
ControlBehaviors::Instance().SendBehaviorListToClient(context);
|
||||
});
|
||||
ControlBehaviors::Instance().SendBehaviorListToClient(context);
|
||||
}
|
||||
|
||||
void ControlBehaviors::SendBehaviorListToClient(const ControlBehaviorContext& context) {
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "dChatFilter.h"
|
||||
|
||||
#include "DluAssert.h"
|
||||
#include "Loot.h"
|
||||
|
||||
template <>
|
||||
void Strip::HandleMsg(AddStripMessage& msg) {
|
||||
@@ -149,7 +150,14 @@ void Strip::Spawn(LOT lot, Entity& entity) {
|
||||
// Spawns a specific drop for all
|
||||
void Strip::SpawnDrop(LOT dropLOT, Entity& entity) {
|
||||
for (auto* const player : PlayerManager::GetAllPlayers()) {
|
||||
GameMessages::SendDropClientLoot(player, entity.GetObjectID(), dropLOT, 0, entity.GetPosition());
|
||||
GameMessages::DropClientLoot lootMsg{};
|
||||
lootMsg.target = player->GetObjectID();
|
||||
lootMsg.ownerID = player->GetObjectID();
|
||||
lootMsg.sourceID = entity.GetObjectID();
|
||||
lootMsg.item = dropLOT;
|
||||
lootMsg.count = 1;
|
||||
lootMsg.spawnPos = entity.GetPosition();
|
||||
Loot::DropItem(*player, lootMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user