Correctly read in bitStream

This commit is contained in:
David Markowitz 2022-12-19 00:24:39 -08:00
parent 9cfc126842
commit d78b2958d3
2 changed files with 12 additions and 0 deletions

View File

@ -31,6 +31,14 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
return;
}
if (m_ProjectileType == 1) {
NiPoint3 targetPosition = NiPoint3::ZERO;
if (!bitStream->Read(targetPosition)) {
Game::logger->Log("ProjectileAttackBehavior", "Unable to read targetPosition from bitStream, aborting Handle! %i", bitStream->GetNumberOfUnreadBits());
return;
};
}
auto* targetEntity = EntityManager::Instance()->GetEntity(target);
for (auto i = 0u; i < this->m_projectileCount; ++i) {
@ -149,4 +157,6 @@ void ProjectileAttackBehavior::Load() {
this->m_trackRadius = GetFloat("track_radius");
this->m_useMouseposit = GetBoolean("use_mouseposit");
this->m_ProjectileType = GetInt("projectile_type");
}

View File

@ -23,6 +23,8 @@ public:
bool m_useMouseposit;
int32_t m_ProjectileType;
/*
* Inherited
*/