diff --git a/system/functions.php b/system/functions.php
index 2f6cf84a..03c2d513 100644
--- a/system/functions.php
+++ b/system/functions.php
@@ -559,7 +559,7 @@ function getCreatureName($killer, $showStatus = false, $extendedInfo = false)
$str .= '' . $player->getName() . '';
if($extendedInfo) {
- $str .= '
'.$player->getLevel().' '.$config['vocations'][$player->getVocation()].'';
+ $str .= '
'.$player->getLevel().' '.$player->getVocationName().'';
}
return $str;
}
diff --git a/system/libs/pot/OTS_Player.php b/system/libs/pot/OTS_Player.php
index d01f7e69..cf8b068e 100644
--- a/system/libs/pot/OTS_Player.php
+++ b/system/libs/pot/OTS_Player.php
@@ -241,11 +241,6 @@ class OTS_Player extends OTS_Row_DAO
if(!isset($this->data['rank_id']) || $this->data['rank_id'] == NULL)
$this->data['rank_id'] = 0;
- if(isset($this->data['promotion'])) {
- global $config;
- if((int)$this->data['promotion'] > 0)
- $this->data['vocation'] += ($this->data['promotion'] * $config['vocations_amount']);
- }
// loads skills
if( $this->isLoaded() && $load_skills)
{
@@ -845,6 +840,12 @@ class OTS_Player extends OTS_Row_DAO
throw new E_OTS_NotLoaded();
}
+ if(isset($this->data['promotion'])) {
+ global $config;
+ if((int)$this->data['promotion'] > 0)
+ return ($this->data['vocation'] + ($this->data['promotion'] * $config['vocations_amount']));
+ }
+
return $this->data['vocation'];
}
@@ -2920,7 +2921,12 @@ class OTS_Player extends OTS_Row_DAO
}
global $config;
- return $config['vocations'][$this->data['vocation']];
+ $voc = $this->getVocation();
+ if(!isset($config['vocations'][$voc])) {
+ return 'Unknown';
+ }
+
+ return $config['vocations'][$voc];
//return POT::getInstance()->getVocationsList()->getVocationName($this->data['vocation']);
}
diff --git a/system/pages/characters.php b/system/pages/characters.php
index b2b1fc5d..68b7dc5f 100644
--- a/system/pages/characters.php
+++ b/system/pages/characters.php
@@ -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,
diff --git a/system/pages/forum/show_thread.php b/system/pages/forum/show_thread.php
index 462dfa09..62e77913 100644
--- a/system/pages/forum/show_thread.php
+++ b/system/pages/forum/show_thread.php
@@ -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())
diff --git a/system/pages/guilds/leave_guild.php b/system/pages/guilds/leave_guild.php
index 180f9f82..26782433 100644
--- a/system/pages/guilds/leave_guild.php
+++ b/system/pages/guilds/leave_guild.php
@@ -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 '.$player->getName().' leaved guild '.$guild->getName().'.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array(
diff --git a/system/pages/guilds/show.php b/system/pages/guilds/show.php
index 9fbd57af..da5cbeb0 100644
--- a/system/pages/guilds/show.php
+++ b/system/pages/guilds/show.php
@@ -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)
{
diff --git a/system/templates/account.management.html.twig b/system/templates/account.management.html.twig
index 0d705de1..6ff4aa86 100644
--- a/system/templates/account.management.html.twig
+++ b/system/templates/account.management.html.twig
@@ -164,7 +164,7 @@
{% for player in players %}
{% set i = i + 1 %}