This commit is contained in:
aozhiwei 2019-06-11 14:07:16 +08:00
parent 9dc884d02d
commit e7915dbe7d

View File

@ -163,21 +163,14 @@ bool MovementComponent::TestCollision()
for (Entity* entity : detection_objects) { for (Entity* entity : detection_objects) {
switch (entity->entity_type) { switch (entity->entity_type) {
case ET_Obstacle: case ET_Obstacle:
{
if (
(hum->last_collision_door == nullptr || hum->last_collision_door != entity) &&
hum->TestCollision(entity)
){
return true;
}
}
break;
case ET_Building: case ET_Building:
{ {
if (hum->TestCollision(entity)) { if (!entity->dead && hum->TestCollision(entity)) {
if (hum->last_collision_door != entity) {
return true; return true;
} }
} }
}
break; break;
default: default:
{ {