This commit is contained in:
aozhiwei 2023-06-14 17:59:41 +08:00
parent 2c5c1971ed
commit 076d21341b

View File

@ -455,11 +455,15 @@ Human* Room::FindEnemy(Human* hum, float range)
if (!hum->dead && if (!hum->dead &&
!a8::HasBitFlag(hum->status, CS_Disable) && !a8::HasBitFlag(hum->status, CS_Disable) &&
hum->team_id != myself->team_id) { hum->team_id != myself->team_id) {
float distance = hum->GetPos().Distance2D2(myself->GetPos()); if (a8::HasBitFlag(hum->status, CS_DisableAttackAndroid) &&
if (distance <= range) { target->IsAndroid()) {
if (distance < last_distance) { } else {
target = hum; float distance = hum->GetPos().Distance2D2(myself->GetPos());
last_distance = distance; if (distance <= range) {
if (distance < last_distance) {
target = hum;
last_distance = distance;
}
} }
} }
} }