mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-06 07:18:42 +00:00
change behavior id to LWOOBJID (#1821)
Convert behavior ID to LWOOBJID length missed header fix sqlite field names sqlite brother
This commit is contained in:
@@ -30,22 +30,27 @@
|
||||
#include "SplitStripMessage.h"
|
||||
#include "UpdateActionMessage.h"
|
||||
#include "UpdateStripUiMessage.h"
|
||||
#include "eObjectBits.h"
|
||||
|
||||
void ControlBehaviors::RequestUpdatedID(ControlBehaviorContext& context) {
|
||||
BehaviorMessageBase msgBase{ context.arguments };
|
||||
const auto oldBehaviorID = msgBase.GetBehaviorId();
|
||||
ObjectIDManager::RequestPersistentID(
|
||||
[context](uint32_t persistentId) {
|
||||
[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;
|
||||
|
||||
args.Insert("behaviorID", std::to_string(persistentId));
|
||||
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(persistentId);
|
||||
context.modelComponent->UpdatePendingBehaviorId(persistentIdBig, oldBehaviorID);
|
||||
|
||||
ControlBehaviors::Instance().SendBehaviorListToClient(context);
|
||||
});
|
||||
|
Reference in New Issue
Block a user