From 67861c278d0cf9e00c83dcedca51f2911c9b9759 Mon Sep 17 00:00:00 2001 From: Exodus4D Date: Sun, 13 Sep 2015 17:48:08 +0200 Subject: [PATCH] close #15 fixed typo --- app/main/controller/api/user.php | 1 - app/main/model/userapimodel.php | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/controller/api/user.php b/app/main/controller/api/user.php index 6b940bfa..7b2bc8fc 100644 --- a/app/main/controller/api/user.php +++ b/app/main/controller/api/user.php @@ -440,7 +440,6 @@ class User extends Controller\Controller{ foreach($apiModels as $apiModel){ $apiModel->delete(); } - } // set main character diff --git a/app/main/model/userapimodel.php b/app/main/model/userapimodel.php index 1cb0ae37..70a6d758 100644 --- a/app/main/model/userapimodel.php +++ b/app/main/model/userapimodel.php @@ -84,7 +84,7 @@ class UserApiModel extends BasicModel { public function hasMainCharacter(){ $hasMain = false; - $characters = $this->getCharacters(); + $characters = $this->getUserCharacters(); foreach($characters as $character){ if($character->isMain()){ $hasMain = true; @@ -111,6 +111,7 @@ class UserApiModel extends BasicModel { // check if this api model had a main character $user = $this->userId; $setNewMain = false; + if($this->hasMainCharacter()){ $setNewMain = true; }