diff --git a/system/functions.php b/system/functions.php
index 514a13d6..aa4a4f2b 100644
--- a/system/functions.php
+++ b/system/functions.php
@@ -575,7 +575,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 6580e96d..cc3aee69 100644
--- a/system/libs/pot/OTS_Player.php
+++ b/system/libs/pot/OTS_Player.php
@@ -216,11 +216,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() )
{
@@ -820,6 +815,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'];
}
@@ -2895,7 +2896,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 ec49e20f..239c7289 100644
--- a/system/pages/characters.php
+++ b/system/pages/characters.php
@@ -375,7 +375,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
'sex' => $player_sex,
'marriage_enabled' => $config['characters']['marriage_info'] && fieldExist('marriage', 'players'),
'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 c322984f..fed562f9 100644
--- a/system/pages/forum/show_thread.php
+++ b/system/pages/forum/show_thread.php
@@ -47,8 +47,8 @@ foreach($threads as $thread)
die();
}
- echo '
' . getPlayerLink($thread['name']) . '
Profession: '.$config['vocations'][$player->getVocation()].' Level: '.$thread['level'].' ';
-
+ echo '' . getPlayerLink($thread['name']) . '
Profession: '.$player->getVocationName().' Level: '.$thread['level'].' ';
+
$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 061cc059..5d2d25bf 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 3b476196..e7826f30 100644
--- a/system/templates/account.management.html.twig
+++ b/system/templates/account.management.html.twig
@@ -160,7 +160,7 @@
{% for player in players %}
{% set i = i + 1 %}
- {{ player.getName() }} | {{ player.getLevel() }} | {{ config.vocations[player.getVocation()] }} | {{ config.towns[player.getTownId()] }} | {% if player.getLastLogin() > 0 %}{{ player.getLastLogin|date('d F Y (H:i)') }}{% else %}Never.{% endif %} | {% if player.isOnline() %}ONLINE{% else %}Offline{% endif %} | {% if player.isHidden() %}Hidden{% else %}Visible{% endif %} | [Edit] |
+ {{ player.getName() }} | {{ player.getLevel() }} | {{ player.getVocationName() }} | {{ config.towns[player.getTownId()] }} | {% if player.getLastLogin() > 0 %}{{ player.getLastLogin|date('d F Y (H:i)') }}{% else %}Never.{% endif %} | {% if player.isOnline() %}ONLINE{% else %}Offline{% endif %} | {% if player.isHidden() %}Hidden{% else %}Visible{% endif %} | [Edit] |
{% endfor %}
diff --git a/system/templates/characters.html.twig b/system/templates/characters.html.twig
index bf2c06a5..48e8405c 100644
--- a/system/templates/characters.html.twig
+++ b/system/templates/characters.html.twig
@@ -380,12 +380,8 @@
|
{{ i }}. {{ player.getName() }}{% if player.isDeleted() %} [DELETED]{% endif %}
|
- {% set vocation = 'Unknown' %}
- {% if config.vocations[player.getVocation()] is defined %}
- {% set vocation = config.vocations[player.getVocation()] %}
- {% endif %}
- {{ player.getLevel() }} {{ vocation }} |
+ {{ player.getLevel() }} {{ player.getVocationName() }} |
{% if player.isOnline() %}Online{% endif %} |
| |