From 28bab110fe755646969059d275e07fc723ff8b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ki=C3=ABd=20Llaentenn?= Date: Mon, 28 Aug 2023 19:24:44 -0400 Subject: [PATCH] feat: AI: face defender when attacking --- src/types.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/types.zig b/src/types.zig index 61b0ad02..8e94f47f 100644 --- a/src/types.zig +++ b/src/types.zig @@ -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 //