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);
|
verify_number($experience, 'Experience', 20);
|
||||||
|
|
||||||
$vocation = $_POST['vocation'];
|
$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
|
||||||
$health = $_POST['health'];
|
$health = $_POST['health'];
|
||||||
@ -357,14 +361,12 @@ $account = $player->getAccount();
|
|||||||
<td>
|
<td>
|
||||||
<select name="vocation">
|
<select name="vocation">
|
||||||
<?php
|
<?php
|
||||||
$i = 0;
|
foreach($config['vocations'] as $id => $name)
|
||||||
foreach($config['vocations'] as $voc)
|
|
||||||
{
|
{
|
||||||
echo '<option value=' . $i;
|
echo '<option value=' . $id;
|
||||||
if($i == $player->getVocation())
|
if($id == $player->getVocation())
|
||||||
echo ' selected="selected"';
|
echo ' selected="selected"';
|
||||||
echo '>' . $voc . '</option>';
|
echo '>' . $name . '</option>';
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user