mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* fixed saving custom vocations in admin panel (#36)
This commit is contained in:
parent
792770e5e2
commit
7ab1c1170f
@ -120,7 +120,11 @@ if($id > 0) {
|
||||
verify_number($experience, 'Experience', 20);
|
||||
|
||||
$vocation = $_POST['vocation'];
|
||||
verify_number($vocation, 'Vocation id', 1);
|
||||
verify_number($vocation, 'Vocation id', 11);
|
||||
|
||||
if(!isset($config['vocations'][$vocation])) {
|
||||
echo_error("Vocation with this id doesn't exist.");
|
||||
}
|
||||
|
||||
// health
|
||||
$health = $_POST['health'];
|
||||
@ -357,14 +361,12 @@ $account = $player->getAccount();
|
||||
<td>
|
||||
<select name="vocation">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach($config['vocations'] as $voc)
|
||||
foreach($config['vocations'] as $id => $name)
|
||||
{
|
||||
echo '<option value=' . $i;
|
||||
if($i == $player->getVocation())
|
||||
echo '<option value=' . $id;
|
||||
if($id == $player->getVocation())
|
||||
echo ' selected="selected"';
|
||||
echo '>' . $voc . '</option>';
|
||||
$i++;
|
||||
echo '>' . $name . '</option>';
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user