Commit f00db7b7 authored by AnimeGitB's avatar AnimeGitB Committed by Melledy
Browse files

Allow offline Player objects to return their Account

parent a3b4a118
...@@ -7,6 +7,7 @@ import emu.grasscutter.data.GameData; ...@@ -7,6 +7,7 @@ import emu.grasscutter.data.GameData;
import emu.grasscutter.data.excels.PlayerLevelData; import emu.grasscutter.data.excels.PlayerLevelData;
import emu.grasscutter.data.excels.WeatherData; import emu.grasscutter.data.excels.WeatherData;
import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.database.DatabaseManager;
import emu.grasscutter.game.Account; import emu.grasscutter.game.Account;
import emu.grasscutter.game.CoopRequest; import emu.grasscutter.game.CoopRequest;
import emu.grasscutter.game.ability.AbilityManager; import emu.grasscutter.game.ability.AbilityManager;
...@@ -295,7 +296,9 @@ public class Player { ...@@ -295,7 +296,9 @@ public class Player {
} }
public Account getAccount() { public Account getAccount() {
return account; if (this.account == null)
this.account = DatabaseHelper.getAccountById(Integer.toString(this.id));
return this.account;
} }
public void setAccount(Account account) { public void setAccount(Account account) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment