This commit is contained in:
aozhiwei 2021-06-10 10:28:56 +08:00
parent 957d78e532
commit 08ce7453fe
3 changed files with 21 additions and 11 deletions

View File

@ -566,3 +566,13 @@ void Obstacle::OnBulletHit(Bullet* bullet)
#endif
}
}
bool Obstacle::CanThroughable(Creature* c)
{
return false;
}
bool Obstacle::CanThroughable(Bullet* bullet)
{
return false;
}

View File

@ -42,8 +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(Creature* c) { return false; }
virtual bool CanThroughable(Bullet* bullet) { return false; }
virtual bool CanThroughable(Creature* c);
virtual bool CanThroughable(Bullet* bullet);
void Explosion(Bullet* bullet);
void SetDoorInfo(Building* building, int door_id_x);
bool IsDoor();

View File

@ -92,15 +92,6 @@ void RoomObstacle::RecalcSelfCollider()
}
}
bool RoomObstacle::CanThroughable(Creature* c)
{
if (master.Get()) {
return master.Get()->team_id == c->team_id && temp_through_;
} else {
return temp_through_;
}
}
void RoomObstacle::ActiveTimerFunc()
{
if (!master.Get()) {
@ -473,3 +464,12 @@ void RoomObstacle::Die(Room* room)
DetachFromMaster();
}
}
bool RoomObstacle::CanThroughable(Creature* c)
{
if (master.Get()) {
return master.Get()->team_id == c->team_id && temp_through_;
} else {
return temp_through_;
}
}