mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
* 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:
@@ -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']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user