Some additional fixes for PHP errors

Some additional fixes for PHP errors
This commit is contained in:
novgorodschi catalin
2026-08-17 10:31:03 +03:00
parent d9df87c622
commit 0f81a2b25e
11 changed files with 27 additions and 12 deletions
+2 -1
View File
@@ -25,7 +25,8 @@ $field = 'f' . $id;
$currentLevel = (int) ($village->resarray[$field] ?? 0);
$buildingType = $village->resarray[$field . 't'] ?? 0;
$currentCapacity = $bid10[$currentLevel]['attri'] * STORAGE_MULTIPLIER;
// $bid10 is keyed from level 1 upward; at level 0 (not built yet) fall back to the base capacity
$currentCapacity = ($currentLevel > 0) ? $bid10[$currentLevel]['attri'] * STORAGE_MULTIPLIER : STORAGE_BASE;
$isMax = $building->isMax($buildingType, $id);
$maxLevel = 20;
+2 -1
View File
@@ -25,7 +25,8 @@ $field = 'f' . $id;
$currentLevel = (int) ($village->resarray[$field] ?? 0);
$buildingType = $village->resarray[$field . 't'] ?? 0;
$currentCapacity = $bid11[$currentLevel]['attri'] * STORAGE_MULTIPLIER;
// $bid11 is keyed from level 1 upward; at level 0 (not built yet) fall back to the base capacity
$currentCapacity = ($currentLevel > 0) ? $bid11[$currentLevel]['attri'] * STORAGE_MULTIPLIER : STORAGE_BASE;
$isMax = $building->isMax($buildingType, $id);
$maxLevel = 20;