Skip to content

Commit

Permalink
feat: AI: face defender when attacking
Browse files Browse the repository at this point in the history
  • Loading branch information
kiedtl committed Aug 28, 2023
1 parent f667264 commit 28bab11
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/types.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3026,6 +3026,10 @@ pub const Mob = struct { // {{{
attacker.declareAction(.{ .Attack = .{ .who = recipient, .coord = recipient.coord, .direction = d, .delay = longest_delay } });
}

if (!opts.free_attack) {
attacker.facing = attacker.coord.closestDirectionTo(recipient.coord, state.mapgeometry);
}

// If the defender didn't know about the attacker's existence now's a
// good time to find out
//
Expand Down

0 comments on commit 28bab11

Please sign in to comment.