DarkflameServer/dGame/dBehaviors/AirMovementBehavior.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1005 B
C++
Raw Normal View History

2022-08-06 03:01:59 +00:00
#include "AirMovementBehavior.h"
#include "BehaviorBranchContext.h"
#include "BehaviorContext.h"
#include "EntityManager.h"
void AirMovementBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
uint32_t handle;
bitStream->Read(handle);
context->RegisterSyncBehavior(handle, this, branch);
}
void AirMovementBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
const auto handle = context->GetUniqueSkillId();
bitStream->Write(handle);
}
void AirMovementBehavior::Sync(BehaviorContext* context, RakNet::BitStream* bit_stream, BehaviorBranchContext branch) {
uint32_t behaviorId;
bit_stream->Read(behaviorId);
LWOOBJID target;
bit_stream->Read(target);
auto* behavior = CreateBehavior(behaviorId);
if (EntityManager::Instance()->GetEntity(target) != nullptr) {
branch.target = target;
}
2022-07-28 13:39:57 +00:00
behavior->Handle(context, bit_stream, branch);
}
void AirMovementBehavior::Load() {
}