From 3706e5feade0a30da8760895cb5f9f94c3dbbe45 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Thu, 14 May 2026 01:07:53 +0300
Subject: [PATCH 33/33] Access areas: Add player specific 'index'

See RM #2023

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

diff --git a/common/fc_types.h b/common/fc_types.h
index df33116971..4f416465d2 100644
--- a/common/fc_types.h
+++ b/common/fc_types.h
@@ -1104,6 +1104,7 @@ BV_DEFINE(bv_tiledefs, MAX_TILEDEFS);
 
 struct access_area {
   const struct player *plr;
+  int index;
   struct city_list *cities;
   bool capital;
   bv_tiledefs tiledefs;
diff --git a/server/aahand.c b/server/aahand.c
index dabc000449..0af76cf25d 100644
--- a/server/aahand.c
+++ b/server/aahand.c
@@ -37,6 +37,7 @@ void access_areas_refresh(struct civ_map *nmap, struct player *plr)
   if (access_utype != nullptr) {
     struct unit *access_unit;
     struct aarea_list *alist;
+    int index = 0;
 
     area_list_clear_plr(plr);
     alist = aarea_list_new();
@@ -56,6 +57,7 @@ void access_areas_refresh(struct civ_map *nmap, struct player *plr)
         struct pf_parameter parameter;
         struct pf_map *pfm;
 
+        aarea->id = index++;
         aarea->cities = city_list_new();
         aarea->capital = is_capital(pcity);
 
-- 
2.53.0

