Moving checking storage null to when loading char
This commit is contained in:
@@ -7402,10 +7402,19 @@ public class Character extends AbstractCharacterObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ret.buddylist.loadFromDb(charid);
|
||||
ret.storage = wserv.getAccountStorage(ret.accountid);
|
||||
|
||||
/*
|
||||
* Bugs when player first time into server
|
||||
* The storage won't exist so nothing to load
|
||||
* and must wait until next login
|
||||
*/
|
||||
if(ret.storage == null) {
|
||||
wserv.loadAccountStorage(ret.accountid);
|
||||
ret.storage = wserv.getAccountStorage(ret.accountid);
|
||||
}
|
||||
|
||||
int startHp = ret.hp, startMp = ret.mp;
|
||||
ret.reapplyLocalStats();
|
||||
ret.changeHpMp(startHp, startMp, true);
|
||||
@@ -8297,15 +8306,6 @@ public class Character extends AbstractCharacterObject {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Bugs when player first time into server
|
||||
* The storage won't get initialize
|
||||
* and must wait until next login
|
||||
*/
|
||||
if (getStorage() == null) {
|
||||
Server.getInstance().getWorld(world).loadAccountStorage(accountid);
|
||||
}
|
||||
|
||||
con.commit();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user