mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-22 03:40:54 +00:00
only allow host to change action
This commit is contained in:
parent
50aba7746f
commit
955811c6de
@ -10,7 +10,13 @@ internal class ChangeActionMessage : QSBWorldObjectMessage<QSBGhostBrain, GhostA
|
||||
|
||||
public override void OnReceiveRemote()
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
DebugLog.ToConsole("Error - Received ChangeActionMessage on host. Something has gone horribly wrong!", OWML.Common.MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"{WorldObject.AttachedObject._name} Change action to {Data}");
|
||||
WorldObject.ChangeAction(WorldObject.GetAction(Data), true);
|
||||
}
|
||||
}
|
||||
}
|
@ -305,6 +305,11 @@ internal class GhostBrainPatches : QSBPatch
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
__instance.GetWorldObject<QSBGhostBrain>().EvaluateActions();
|
||||
return false;
|
||||
}
|
||||
|
@ -546,7 +546,11 @@ public class QSBGhostBrain : WorldObject<GhostBrain>, IGhostObject
|
||||
{
|
||||
AttachedObject.enabled = false;
|
||||
AttachedObject._controller.GetDreamLanternController().enabled = false;
|
||||
ChangeAction(null);
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
ChangeAction(null);
|
||||
}
|
||||
|
||||
_data.OnPlayerExitDreamWorld();
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,12 @@ public class QSBGhostSensors : WorldObject<GhostSensors>, IGhostObject
|
||||
foreach (var pair in _data.players)
|
||||
{
|
||||
var player = pair.Value;
|
||||
|
||||
if (player.player.AssignedSimulationLantern == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var lanternController = player.player.AssignedSimulationLantern.AttachedObject.GetLanternController();
|
||||
var playerLightSensor = Locator.GetPlayerLightSensor();
|
||||
player.sensor.isPlayerHoldingLantern = lanternController.IsHeldByPlayer();
|
||||
|
Loading…
x
Reference in New Issue
Block a user