-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SmrAccount: make getAccountByX consistent
* No more return by reference allowed. See #317. * Remove getAccountByHofName (unused). * Add early (null) return if input is empty. This avoids an extra DB query, but also is an extra sanity check because none of these account fields should EVER be empty. And we want to be very careful not to accidentally give players access to accounts they do not own.
- Loading branch information
Showing
2 changed files
with
13 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,11 +454,11 @@ function changeNPCLogin() { | |
|
||
if(SmrAccount::getAccountByName($NPC_LOGIN['Login'])==null) { | ||
debug('Creating account for: '.$NPC_LOGIN['Login']); | ||
$account =& SmrAccount::createAccount($NPC_LOGIN['Login'],'','[email protected]','NPC','NPC',0,0); | ||
$account = SmrAccount::createAccount($NPC_LOGIN['Login'],'','[email protected]','NPC','NPC',0,0); | ||
$account->setValidated(true); | ||
} | ||
else { | ||
$account =& SmrAccount::getAccountByName($NPC_LOGIN['Login']); | ||
$account = SmrAccount::getAccountByName($NPC_LOGIN['Login']); | ||
} | ||
|
||
$GLOBALS['account'] =& $account; | ||
|