Use balance schema v2 in stats editor

This commit is contained in:
Emporex committed 2026-10-11 13:08:13 +02:00
1 parent 417b2d87b0
commit c342fcef30
1 file changed
+1 -1
+1 -1
View File
@@ -183,7 +183,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['balance_action'])) {
$rpcBase = preg_replace('~/private_stats$~', '/set_game_balance', (string) ($config['nakama_rpc_url'] ?? ''));
$towerForm = $_POST['towers'] ?? [];
$enemyForm = $_POST['enemies'] ?? [];
$balance = ['schema' => 1, 'towers' => [], 'enemies' => []];
$balance = ['schema' => 2, 'towers' => [], 'enemies' => []];
for ($i = 0; $i < 7; $i++) {
$row = is_array($towerForm[$i] ?? null) ? $towerForm[$i] : [];
$balance['towers'][] = ['cost' => $row['cost'] ?? '', 'damage' => $row['damage'] ?? '', 'range' => $row['range'] ?? '', 'cooldown' => $row['cooldown'] ?? '', 'targetClass' => $row['targetClass'] ?? '', 'bothScale' => $row['bothScale'] ?? ''];