diff --git a/server/gameserver/moveableentity.cc b/server/gameserver/moveableentity.cc index 5f3c106f..ee11cc02 100644 --- a/server/gameserver/moveableentity.cc +++ b/server/gameserver/moveableentity.cc @@ -90,6 +90,12 @@ void MoveableEntity::SetMoveDir(const a8::Vec2& move_dir) ++chg_move_dir_times_; } +void MoveableEntity::SetTargetPos(const a8::Vec3& target_pos) +{ + target_pos_ = target_pos; + ++chg_target_pos_times_; +} + void MoveableEntity::SetAttackDir(const a8::Vec2& attack_dir) { attack_dir_ = attack_dir; diff --git a/server/gameserver/moveableentity.h b/server/gameserver/moveableentity.h index 3f39a356..d398f90b 100644 --- a/server/gameserver/moveableentity.h +++ b/server/gameserver/moveableentity.h @@ -26,12 +26,15 @@ class MoveableEntity : public RoomEntity virtual void UpdateCharImage(const char* file, int line, const char* func); virtual const a8::Vec2& GetMoveDir() { return move_dir_; }; virtual void SetMoveDir(const a8::Vec2& move_dir); + virtual const a8::Vec3& GetTargetPos() { return target_pos_; }; + virtual void SetTargetPos(const a8::Vec3& target_pos); virtual const a8::Vec2& GetAttackDir() { return attack_dir_; }; virtual void SetAttackDir(const a8::Vec2& attack_dir); virtual const a8::Vec2& GetShotDir() { return attack_dir_; }; int GetChgMoveDirTimes() { return chg_move_dir_times_; } int GetChgAttackDirTimes() { return chg_attack_dir_times_; } float GetAttackDirRotate(); + int GetChgTargetPosTimes() { return chg_target_pos_times_; } protected: int updated_times_ = 0; @@ -39,7 +42,9 @@ protected: private: a8::Vec2 move_dir_; a8::Vec2 attack_dir_; + a8::Vec3 target_pos_; std::set grid_list_; int chg_move_dir_times_ = 0; int chg_attack_dir_times_ = 0; + int chg_target_pos_times_ = 0; };