compare: expose active action inheritance points
This commit is contained in:
@@ -330,6 +330,17 @@ function comparisonTurnStateSnapshot(array $request): array
|
|||||||
$result[$key] = comparisonOptionalCode($result[$key] ?? null);
|
$result[$key] = comparisonOptionalCode($result[$key] ?? null);
|
||||||
}
|
}
|
||||||
$result['maxBelong'] = (int)($result['meta']['max_belong'] ?? 0);
|
$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;
|
return $result;
|
||||||
},
|
},
|
||||||
comparisonRowsById('general', 'no', $generalIds),
|
comparisonRowsById('general', 'no', $generalIds),
|
||||||
|
|||||||
Reference in New Issue
Block a user