diff --git a/server/gameserver/bullet.cc b/server/gameserver/bullet.cc index 235c452..9cb47d6 100644 --- a/server/gameserver/bullet.cc +++ b/server/gameserver/bullet.cc @@ -32,6 +32,7 @@ void Bullet::Initialize() MoveableEntity::Initialize(); RecalcSelfCollider(); ability_ = sender.Get()->GetAbility(); + is_curr_weapon = sender.Get()->GetCurrWeapon()->meta == gun_meta; } void Bullet::Update(int delta_time) @@ -441,7 +442,7 @@ void Bullet::ProcOilBucketBomb(int delay_time) bool Bullet::IsCurrWeapon() { - return sender.Get()->GetCurrWeapon()->meta == gun_meta; + return is_curr_weapon; } void Bullet::AddGunBuff() diff --git a/server/gameserver/bullet.h b/server/gameserver/bullet.h index eb0b52e..d6850d9 100644 --- a/server/gameserver/bullet.h +++ b/server/gameserver/bullet.h @@ -64,6 +64,7 @@ private: CircleCollider* self_collider_ = nullptr; bool later_removed_ = false; std::shared_ptr ability_; + bool is_curr_weapon = false; friend class EntityFactory; };