Moving checking storage null to when loading char

This commit is contained in:
Đạt Nhân Trương
2022-08-11 01:33:48 +07:00
parent 81e15f205b
commit 85e5356a9c

View File

@@ -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) {