mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-12 01:21:30 +01:00
Fix for servers that don't have the cap & conditions columns
This commit is contained in:
@@ -1390,12 +1390,7 @@ class OTS_Player extends OTS_Row_DAO
|
||||
*/
|
||||
public function getCap()
|
||||
{
|
||||
if( !isset($this->data['cap']) )
|
||||
{
|
||||
throw new E_OTS_NotLoaded();
|
||||
}
|
||||
|
||||
return $this->data['cap'];
|
||||
return $this->data['cap'] ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -149,7 +149,10 @@ class CreateCharacter
|
||||
if($db->hasColumn('players', 'direction'))
|
||||
$player->setDirection($playerSample->getDirection());
|
||||
|
||||
$player->setConditions($playerSample->getConditions());
|
||||
if($db->hasColumn('players', 'conditions')) {
|
||||
$player->setConditions($playerSample->getConditions());
|
||||
}
|
||||
|
||||
$rank = $playerSample->getRank();
|
||||
if($rank->isLoaded()) {
|
||||
$player->setRank($playerSample->getRank());
|
||||
@@ -183,7 +186,11 @@ class CreateCharacter
|
||||
$player->setLookHead($playerSample->getLookHead());
|
||||
$player->setLookLegs($playerSample->getLookLegs());
|
||||
$player->setLookType($playerSample->getLookType());
|
||||
$player->setCap($playerSample->getCap());
|
||||
|
||||
if($db->hasColumn('players', 'cap')) {
|
||||
$player->setCap($playerSample->getCap());
|
||||
}
|
||||
|
||||
$player->setBalance(0);
|
||||
$player->setPosX(0);
|
||||
$player->setPosY(0);
|
||||
|
||||
Reference in New Issue
Block a user