* important fix for servers with promotion column (#36)

* caused player.vocation to be resetted when saving player, for example:
on change name, accept invite to guild, leave guild
* fixed empty success message on leave guild
* (internal) using $player->getVocationName() where possible instead of
older method
* fixed some warning in guild show
This commit is contained in:
slawkens1
2018-01-08 01:00:56 +01:00
parent acf2e2fb4a
commit 4102b44352
8 changed files with 20 additions and 19 deletions

View File

@@ -386,7 +386,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
'sex' => $player_sex,
'marriage_enabled' => $config['characters']['marriage_info'] && $db->hasColumn('players', 'marriage'),
'marital_status' => $marital_status,
'vocation' => $config['vocations'][$player->getVocation()],
'vocation' => $player->getVocationName(),
'frags_enabled' => $frags_enabled,
'frags_count' => $frags_count,
'town' => isset($config['towns'][$player->getTownId()]) ? $config['towns'][$player->getTownId()] : null,

View File

@@ -63,10 +63,7 @@ foreach($posts as &$post)
$post['group'] = $groupName;
$post['player_link'] = getPlayerLink($player->getName());
$post['vocation'] = 'Unknown';
if(isset($config['vocations'][$player->getVocation()])) {
$post['vocation'] = $config['vocations'][$player->getVocation()];
}
$post['vocation'] = $player->getVocationName();
$rank = $player->getRank();
if($rank->isLoaded())

View File

@@ -94,7 +94,7 @@ else
{
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$player->setRank();
$twig->render('success.html.twig', array(
echo $twig->render('success.html.twig', array(
'title' => 'Leave guild',
'description' => 'Player with name <b>'.$player->getName().'</b> leaved guild <b>'.$guild->getName().'</b>.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array(

View File

@@ -10,6 +10,7 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Guilds';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
if(!Validator::guildName($guild_name))
$errors[] = Validator::getLastError();
@@ -41,6 +42,7 @@ else
$players_from_account_in_guild = array();
if($logged)
{
$players_from_account_ids = array();
$account_players = $account_logged->getPlayers();
foreach($account_players as $player)
{