mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-12-11 20:15:10 +01:00
Fix quantum objects near spawn not having an initial controlling player set
This commit is contained in:
parent
7d4ad5dac0
commit
5525a27ecf
@ -71,6 +71,15 @@ public abstract class QSBQuantumObject<T> : WorldObject<T>, IQSBQuantumObject
|
||||
if (attachedShapes.All(x => x.enabled && x.gameObject.activeInHierarchy && x.active))
|
||||
{
|
||||
IsEnabled = true;
|
||||
// If the shapes are already enabled then OnShapeActivated won't get triggered until it turns off and on again
|
||||
// Then nobody ends up controlling the object until that happens
|
||||
// This doesn't affect base game because there are no quantum objects at spawn, but can affect NH mods
|
||||
// In this case where the host has spawned in and the object is enabled with no ControllingPlayer, the host should take control
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
// first player is the host
|
||||
ControllingPlayer = QSBPlayerManager.PlayerList[0].PlayerId;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -215,7 +224,7 @@ public abstract class QSBQuantumObject<T> : WorldObject<T>, IQSBQuantumObject
|
||||
{
|
||||
_visibleToProbes.Add(player);
|
||||
}
|
||||
|
||||
|
||||
AttachedObject._visibleInProbeSnapshot = true;
|
||||
return;
|
||||
}
|
||||
@ -261,7 +270,7 @@ public abstract class QSBQuantumObject<T> : WorldObject<T>, IQSBQuantumObject
|
||||
{
|
||||
_visibleToProbes.Remove(player);
|
||||
}
|
||||
|
||||
|
||||
AttachedObject._visibleInProbeSnapshot = _visibleToProbes.Any();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user