Use balance schema v2 in stats editor
This commit is contained in:
1 parent
417b2d87b0
commit
c342fcef30
1 file changed
+1
-1
@@ -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'] ?? ''));
|
$rpcBase = preg_replace('~/private_stats$~', '/set_game_balance', (string) ($config['nakama_rpc_url'] ?? ''));
|
||||||
$towerForm = $_POST['towers'] ?? [];
|
$towerForm = $_POST['towers'] ?? [];
|
||||||
$enemyForm = $_POST['enemies'] ?? [];
|
$enemyForm = $_POST['enemies'] ?? [];
|
||||||
$balance = ['schema' => 1, 'towers' => [], 'enemies' => []];
|
$balance = ['schema' => 2, 'towers' => [], 'enemies' => []];
|
||||||
for ($i = 0; $i < 7; $i++) {
|
for ($i = 0; $i < 7; $i++) {
|
||||||
$row = is_array($towerForm[$i] ?? null) ? $towerForm[$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'] ?? ''];
|
$balance['towers'][] = ['cost' => $row['cost'] ?? '', 'damage' => $row['damage'] ?? '', 'range' => $row['range'] ?? '', 'cooldown' => $row['cooldown'] ?? '', 'targetClass' => $row['targetClass'] ?? '', 'bothScale' => $row['bothScale'] ?? ''];
|
||||||
|
|||||||
Reference in new issue
Block a user