From 957d78e5327ed5a74416aaab9c571c63d43bcdd8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 9 Jun 2021 19:11:19 +0800 Subject: [PATCH] 1 --- server/gameserver/obstacle.h | 4 +++- server/gameserver/roomobstacle.cc | 4 ++-- server/gameserver/roomobstacle.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/gameserver/obstacle.h b/server/gameserver/obstacle.h index de88ad2..f570b22 100644 --- a/server/gameserver/obstacle.h +++ b/server/gameserver/obstacle.h @@ -14,6 +14,7 @@ namespace metatable } class Room; +class Creature; class Human; class Building; class CircleCollider; @@ -41,7 +42,8 @@ class Obstacle : public Entity virtual void OnPreCollision(Room* room) override; virtual void OnBulletHit(Bullet* bullet) override; virtual bool IsTerminatorAirDropBox(Room* room) { return false; } - virtual bool CanThroughable(Human* num) { return false; } + virtual bool CanThroughable(Creature* c) { return false; } + virtual bool CanThroughable(Bullet* bullet) { return false; } void Explosion(Bullet* bullet); void SetDoorInfo(Building* building, int door_id_x); bool IsDoor(); diff --git a/server/gameserver/roomobstacle.cc b/server/gameserver/roomobstacle.cc index b797bdd..6b06704 100644 --- a/server/gameserver/roomobstacle.cc +++ b/server/gameserver/roomobstacle.cc @@ -92,10 +92,10 @@ void RoomObstacle::RecalcSelfCollider() } } -bool RoomObstacle::CanThroughable(Human* hum) +bool RoomObstacle::CanThroughable(Creature* c) { if (master.Get()) { - return master.Get()->team_id == hum->team_id && temp_through_; + return master.Get()->team_id == c->team_id && temp_through_; } else { return temp_through_; } diff --git a/server/gameserver/roomobstacle.h b/server/gameserver/roomobstacle.h index abf451f..d4d0971 100644 --- a/server/gameserver/roomobstacle.h +++ b/server/gameserver/roomobstacle.h @@ -17,7 +17,7 @@ class RoomObstacle : public Obstacle virtual void Initialize() override; virtual void RecalcSelfCollider() override; virtual bool IsTerminatorAirDropBox(Room* room) override { return is_terminator_airdrop_box; } - virtual bool CanThroughable(Human* hum) override; + virtual bool CanThroughable(Creature* c) override; void ActiveTimerFunc(); void UpdateTimerFunc(); void Active();