Skip to content

Commit

Permalink
Merge pull request #201 from Raicuparta/alek/loop-fix
Browse files Browse the repository at this point in the history
loop fix
  • Loading branch information
misternebula authored Aug 23, 2020
2 parents 5dd4701 + 1a92345 commit 2d0895f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion QSB/ElevatorSync/ElevatorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private void OnSceneLoaded(OWScene scene, bool isInUniverse)
_elevators = Resources.FindObjectsOfTypeAll<Elevator>().ToList();
for (var id = 0; id < _elevators.Count; id++)
{
var qsbElevator = new QSBElevator();
var qsbElevator = WorldRegistry.GetObject<QSBElevator>(id) ?? new QSBElevator();
qsbElevator.Init(_elevators[id], id);
WorldRegistry.AddObject(qsbElevator);
}
Expand Down
2 changes: 1 addition & 1 deletion QSB/GeyserSync/GeyserManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private void OnSceneLoaded(OWScene scene, bool isInUniverse)
var geyserControllers = Resources.FindObjectsOfTypeAll<GeyserController>();
for (var id = 0; id < geyserControllers.Length; id++)
{
var qsbGeyser = new QSBGeyser();
var qsbGeyser = WorldRegistry.GetObject<QSBGeyser>(id) ?? new QSBGeyser();
qsbGeyser.Init(geyserControllers[id], id);
WorldRegistry.AddObject(qsbGeyser);
}
Expand Down
2 changes: 1 addition & 1 deletion QSB/TransformSync/QSBSectorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private void OnSceneLoaded(OWScene scene, bool isInUniverse)
var sectors = Resources.FindObjectsOfTypeAll<Sector>().ToList();
for (var id = 0; id < sectors.Count; id++)
{
var qsbSector = new QSBSector();
var qsbSector = WorldRegistry.GetObject<QSBSector>(id) ?? new QSBSector();
qsbSector.Init(sectors[id], id);
WorldRegistry.AddObject(qsbSector);
}
Expand Down
4 changes: 4 additions & 0 deletions QSB/WorldSync/WorldRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ public static class WorldRegistry

public static void AddObject(WorldObject worldObject)
{
if (_worldObjects.Contains(worldObject))
{
return;
}
_worldObjects.Add(worldObject);
}

Expand Down
2 changes: 1 addition & 1 deletion QSB/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"name": "Quantum Space Buddies",
"description": "Adds online multiplayer to the game.",
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
"version": "0.5.0",
"version": "0.5.1",
"owmlVersion": "0.7.3"
}

0 comments on commit 2d0895f

Please sign in to comment.