Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: home worlds are ticked twice #2360

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/emu/grasscutter/game/home/HomeWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public HomeWorld(GameServer server, Player owner) {
super(server, owner);

this.home = owner.isOnline() ? owner.getHome() : GameHome.getByUid(owner.getUid());
server.registerHomeWorld(this);
this.refreshModuleManager();
server.registerHomeWorld(this);
}

@Override
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/emu/grasscutter/server/game/GameServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,9 @@ public Account getAccountByName(String username) {
public synchronized void onTick() {
var tickStart = Instant.now();

// Tick worlds.
// Tick worlds and home worlds.
this.worlds.removeIf(World::onTick);

// Tick Home Worlds (Not remove, HomeWorld is constant).
this.homeWorlds.values().forEach(HomeWorld::onTick);

// Tick players.
this.players.values().forEach(Player::onTick);

Expand Down
Loading