1
This commit is contained in:
parent
60cfa50cc4
commit
9e2ca60298
@ -723,8 +723,33 @@ void Bullet::GetHitThings(BulletCheckResult& result)
|
||||
#if 1
|
||||
room->TraverseEntityList
|
||||
(
|
||||
[] (Entity* e)
|
||||
[this] (Entity* e)
|
||||
{
|
||||
if (e->IsEntityType(ET_Obstacle)) {
|
||||
Obstacle* ob = (Obstacle*)e;
|
||||
if (ob->meta->thing_type() == kObstacleStrengthenWall) {
|
||||
if (!strengthened_ && sender.Get() &&
|
||||
sender.Get()->team_id == ob->GetTeamId(room)) {
|
||||
bool ret = Collision::Check2dRotationRectangle
|
||||
(GetPos().x,
|
||||
GetPos().y,
|
||||
gun_meta->bullet_rad(),
|
||||
ob->GetPos().x,
|
||||
ob->GetPos().y,
|
||||
ob->meta->width(),
|
||||
ob->meta->height(),
|
||||
ob->GetRotate() * 180.0f
|
||||
);
|
||||
if (ret) {
|
||||
strengthened_ = true;
|
||||
OnStrengthen(ob);
|
||||
#ifdef DEBUG
|
||||
a8::XPrintf("命中能量墙\n", {});
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user