Skip to content

Commit

Permalink
Only shoot at enemies in LOS
Browse files Browse the repository at this point in the history
  • Loading branch information
wallabra committed Jan 17, 2025
1 parent fe4108e commit acff086
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ZScript.zs
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,7 @@ class ZTBotController : Actor {
ZetaCape.MakeFor(other);
}

if (CVar.FindCVar("deathmatch").GetInt() > 0) {
other.bFRIENDLY = false;
}
other.bFRIENDLY = CVar.FindCVar("deathmatch").GetInt() == 0;

RespawnReset();
}
Expand Down Expand Up @@ -2518,7 +2516,7 @@ class ZTBotController : Actor {
let dir = AngleToVector(possessed.angle);
double ddot = (off.x * dir.x) + (off.y * dir.y);

if (dDot <= 0) {
if (!possessed.CheckSight(enemy) || dDot <= 0) {
possessed.EndShoot();
}

Expand Down Expand Up @@ -2708,6 +2706,10 @@ class ZTBotController : Actor {
return true;
}

if (potentialCommander.cont == null || potentialCommander.cont.commander == null) {
return false;
}

let nextCommander = ZetaBotPawn(potentialCommander.cont.commander);

if (potentialCommander == nextCommander) {
Expand Down

0 comments on commit acff086

Please sign in to comment.