mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-23 14:36:22 +01:00
Feature/ots player rewrite (#348)
* [WIP] Rewrite OTS_Player class * Fix exception on load a non existing player * Fix for servers that don't have the cap & conditions columns * Fix created column on player save * Update OTS_Player.php * Add Monk Sample + fixes * Move FAQ creation to import_base_data + cleanup
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -23,6 +23,8 @@ class Player extends Model {
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'worldid' => 'integer',
|
||||
'sex' => 'integer',
|
||||
|
||||
Reference in New Issue
Block a user