Merge branch 'main' into rotation-behaviors

This commit is contained in:
David Markowitz
2025-10-19 22:28:30 -07:00
255 changed files with 5051 additions and 1825 deletions

View File

@@ -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) {

View File

@@ -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);
}
}