diff --git a/server/gameserver/collision.cc b/server/gameserver/collision.cc index c9ebf178..cb131ddb 100644 --- a/server/gameserver/collision.cc +++ b/server/gameserver/collision.cc @@ -26,6 +26,11 @@ bool Collision::CheckCC(Creature* a, Creature* b) return false; } +bool Collision::CheckCC(Creature* a, float radius, Creature* b, float radis) +{ + return false; +} + bool Collision::CheckCB(Creature* c, Obstacle* b) { return false; diff --git a/server/gameserver/collision.h b/server/gameserver/collision.h index dd0b0e18..7aae6c25 100644 --- a/server/gameserver/collision.h +++ b/server/gameserver/collision.h @@ -10,6 +10,7 @@ class Collision static bool CheckBullet(IBullet* bullet, Creature* c); static bool CheckBullet(IBullet* bullet, Entity* c); static bool CheckCC(Creature* a, Creature* b); + static bool CheckCC(Creature* a, float radius, Creature* b, float radis); static bool CheckCB(Creature* c, Obstacle* b); /* diff --git a/server/gameserver/roomobstacle.cc b/server/gameserver/roomobstacle.cc index fcbd2d02..7c5d58dd 100644 --- a/server/gameserver/roomobstacle.cc +++ b/server/gameserver/roomobstacle.cc @@ -817,12 +817,13 @@ void RoomObstacle::ActiveMedicalStation() if (master.Get()->team_id == hum->team_id && !hum->dead ) { - if (IntersectCircleCircle( - GetPos().ToVec2(), - SkillHelper::GetYlzRange(skill_meta), - hum->GetPos().ToVec2(), - hum->GetRadius() - )) { + if (Collision::CheckCC + ( + this + SkillHelper::GetYlzRange(skill_meta), + hum, + hum->GetRadius() + )) { target_list.insert(hum); } } diff --git a/server/gameserver/types.cc b/server/gameserver/types.cc index 9efb33b9..689c0b08 100644 --- a/server/gameserver/types.cc +++ b/server/gameserver/types.cc @@ -15,18 +15,6 @@ float Position::ManhattanDistance2D(const Position& target_pos) const return ToVec2().ManhattanDistance(target_pos.ToVec2()); } -a8::Vec2 Position::CalcDir2D(const Position& target_pos) const -{ - return a8::Vec2(target_pos.x, target_pos.z) - a8::Vec2(x, z); -} - -void Position::FromVec3(const a8::Vec3 v) -{ - x = v.x; - y = v.y; - z = v.z; -} - void Position::FromGlmVec3(const glm::vec3 v) { x = v.x; @@ -34,14 +22,6 @@ void Position::FromGlmVec3(const glm::vec3 v) z = v.z; } -a8::Vec2 Position::ToVec2() const -{ - a8::Vec2 v2; - v2.x = x; - v2.y = z; - return v2; -} - glm::vec3 Position::ToGlmVec3() const { glm::vec3 v; diff --git a/server/gameserver/types.h b/server/gameserver/types.h index 02823c9e..cea34cd9 100644 --- a/server/gameserver/types.h +++ b/server/gameserver/types.h @@ -70,14 +70,10 @@ struct Position float Distance2D2(const Position& pos) const; float DistanceGlmVec3(const glm::vec3& v) const; float ManhattanDistance2D(const Position& target_pos) const; - a8::Vec2 CalcDir2D(const Position& target_pos) const; glm::vec3 CalcDir(const Position& target_pos) const; - void FromVec3(const a8::Vec3 v); - void FromGlmVec3(const glm::vec3 v); - a8::Vec2 ToVec2() const; glm::vec3 ToGlmVec3() const; const Position& AddGlmVec3(const glm::vec3& v);