From b417e117adc2d8fcf3a3716898d3656201be6921 Mon Sep 17 00:00:00 2001 From: hided62 Date: Sun, 26 Jul 2026 21:49:35 +0000 Subject: [PATCH] compare: expose active action inheritance points --- hwe/compare/turn_state_snapshot.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hwe/compare/turn_state_snapshot.php b/hwe/compare/turn_state_snapshot.php index 46bcf32e..ec218135 100644 --- a/hwe/compare/turn_state_snapshot.php +++ b/hwe/compare/turn_state_snapshot.php @@ -330,6 +330,17 @@ function comparisonTurnStateSnapshot(array $request): array $result[$key] = comparisonOptionalCode($result[$key] ?? null); } $result['maxBelong'] = (int)($result['meta']['max_belong'] ?? 0); + $ownerId = (int)($row['owner'] ?? 0); + $activeActionPoints = 0; + if ($ownerId > 0) { + $inheritanceStorage = KVStorage::getStorage(DB::db(), "inheritance_{$ownerId}"); + $inheritanceStorage->resetCache(); + $stored = $inheritanceStorage->getValue('active_action'); + if (is_array($stored) && (is_int($stored[0] ?? null) || is_float($stored[0] ?? null))) { + $activeActionPoints = $stored[0]; + } + } + $result['inheritActiveActionPoints'] = $activeActionPoints; return $result; }, comparisonRowsById('general', 'no', $generalIds),