mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* applied changes from master
* important fix for servers with promotion column * 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:
@@ -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']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user