Fix building materials and road/aqueduct rotation for remote players

Add UpdateMaterialSelection() and UpdateRotation() calls after building
placement to fix visual issues when host views client's buildings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-14 15:27:41 +01:00
parent c6ca1abc54
commit 6b014c72db

View File

@@ -125,6 +125,23 @@ namespace KCM.Packets.Game.GameWorld
Main.helper.Log("unpack stage 2");
structureData.UnpackStage2(building);
// Update materials/textures for correct display
building.UpdateMaterialSelection();
// Update road rotation for proper visuals
Road roadComp = building.GetComponent<Road>();
if (roadComp != null)
{
roadComp.UpdateRotation();
}
// Update aqueduct rotation
Aqueduct aqueductComp = building.GetComponent<Aqueduct>();
if (aqueductComp != null)
{
aqueductComp.UpdateRotation();
}
building.SetVisibleForFog(false);
Main.helper.Log("Landmass owner take ownership");