This commit is contained in:
aozhiwei 2022-10-09 14:16:11 +08:00
parent 46b46871c4
commit ab77a051d6

View File

@ -493,9 +493,25 @@ void Bullet::Check(float distance)
} }
} }
} else if (obstacle->meta->i->thing_type() == kObstacleStrengthenWall) { } else if (obstacle->meta->i->thing_type() == kObstacleStrengthenWall) {
if (!strengthened_ && TestCollision(room, collider)) { if (!strengthened_ && sender.Get() &&
sender.Get()->team_id == obstacle->GetTeamId(room)) {
bool ret = Check2dRotationRectangle
(GetPos().x,
GetPos().y,
gun_meta->i->bullet_rad(),
obstacle->GetPos().x,
obstacle->GetPos().y,
obstacle->meta->i->width(),
obstacle->meta->i->height(),
obstacle->GetRotate() * 180.0f
);
if (ret) {
strengthened_ = true; strengthened_ = true;
OnStrengthen(obstacle); OnStrengthen(obstacle);
#ifdef DEBUG
a8::XPrintf("命中能量墙\n", {});
#endif
}
} }
} }
} }