This commit is contained in:
aozhiwei 2023-04-02 16:27:59 +08:00
parent d145ffaa65
commit 6fa87b3c70

View File

@ -802,12 +802,13 @@ bool Bullet::IsFlyHook()
void Bullet::GetHitThings(BulletCheckResult& result) void Bullet::GetHitThings(BulletCheckResult& result)
{ {
room->TraverseEntityList room->grid_service->TraverseObstacles
( (room->GetRoomIdx(),
[this] (Entity* e) GetGridList(),
[this] (Obstacle* ob, bool& stop)
{ {
if (e->IsEntityType(ET_Obstacle)) { #if 1
Obstacle* ob = (Obstacle*)e; #else
if (ob->meta->thing_type() == kObstacleStrengthenWall) { if (ob->meta->thing_type() == kObstacleStrengthenWall) {
if (!strengthened_ && sender.Get() && if (!strengthened_ && sender.Get() &&
sender.Get()->team_id == ob->GetTeamId(room)) { sender.Get()->team_id == ob->GetTeamId(room)) {
@ -830,8 +831,7 @@ void Bullet::GetHitThings(BulletCheckResult& result)
} }
} }
} }
} #endif
return true;
}); });
} }