From a417917dcc24f76669d8700aaa02a1c29f302814 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 14 Sep 2024 10:04:30 +0300
Subject: [PATCH 32/32] Unhardcode wld.map from action_speculate_unit_on_unit()

See RM #853

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/actions.c | 4 ++--
 common/actions.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/common/actions.c b/common/actions.c
index c442eea7e1..4a4fe6c40a 100644
--- a/common/actions.c
+++ b/common/actions.c
@@ -4820,7 +4820,8 @@ struct act_prob action_speculate_unit_on_city(const struct civ_map *nmap,
   game state changes.
 **************************************************************************/
 struct act_prob
-action_speculate_unit_on_unit(action_id act_id,
+action_speculate_unit_on_unit(const struct civ_map *nmap,
+                              action_id act_id,
                               const struct unit *actor,
                               const struct city *actor_home,
                               const struct tile *actor_tile,
@@ -4831,7 +4832,6 @@ action_speculate_unit_on_unit(action_id act_id,
    * current position rather than on actor_tile. Maybe this function should
    * return ACTPROB_NOT_IMPLEMENTED when one of those is detected and no
    * other requirement makes the action ACTPROB_IMPOSSIBLE? */
-  const struct civ_map *nmap = &(wld.map);
 
   if (omniscient_cheat) {
     if (is_action_enabled_unit_on_unit_full(nmap, act_id,
diff --git a/common/actions.h b/common/actions.h
index 25dd7eaad6..a8d2bac491 100644
--- a/common/actions.h
+++ b/common/actions.h
@@ -601,7 +601,8 @@ action_speculate_unit_on_city(const struct civ_map *nmap,
                               const struct city* target);
 
 struct act_prob
-action_speculate_unit_on_unit(action_id act_id,
+action_speculate_unit_on_unit(const struct civ_map *nmap,
+                              action_id act_id,
                               const struct unit *actor,
                               const struct city *actor_home,
                               const struct tile *actor_tile,
-- 
2.45.2

