Skip to content

Commit

Permalink
Fix terrain not flatten when built on remote planets
Browse files Browse the repository at this point in the history
revert some changes in commit d10dddb
  • Loading branch information
starfi5h committed Apr 10, 2024
1 parent a5fc47d commit e7ed12a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ protected override void ProcessPacket(BuildEntityRequest packet, NebulaConnectio
}
else
{
// Remote planets, or the factory is not loaded yet
planet.factory.BuildFinally(GameMain.mainPlayer, packet.PrebuildId, false, false);
Multiplayer.Session.Factories.AddPlanetTimer(packet.PlanetId);
// setting specifyPlanet here to avoid accessing a null object (see GPUInstancingManager activePlanet getter)
var pData = GameMain.gpuiManager.specifyPlanet;
GameMain.gpuiManager.specifyPlanet = GameMain.galaxy.PlanetById(packet.PlanetId);
// Flatten the terrain for remote planet build by other players
planet.factory.BuildFinally(GameMain.mainPlayer, packet.PrebuildId, true, true);
GameMain.gpuiManager.specifyPlanet = pData;
}

Multiplayer.Session.Factories.EventFactory = null;
Expand Down

0 comments on commit e7ed12a

Please sign in to comment.