fix it yeah

This commit is contained in:
Mister_Nebula 2021-03-29 00:01:26 +01:00
parent 86fa334020
commit 285163f5f6
2 changed files with 11 additions and 3 deletions

View File

@ -358,6 +358,10 @@ namespace QSB.PoolSync
private void OnSocketableRemoved(OWItem socketable)
{
if (_wasLocalInBounds)
{
QSBEventManager.FireEvent(EventNames.QSBExitPlatform, CustomPlatformList.IndexOf(this));
}
if (_slavePlatform == null)
{
return;
@ -560,6 +564,7 @@ namespace QSB.PoolSync
private void OnLeaveBounds()
{
DisconnectCamera();
QSBEventManager.FireEvent(EventNames.QSBExitPlatform, CustomPlatformList.IndexOf(this));
if (_anyoneStillOnPlatform)
{
return;
@ -642,6 +647,9 @@ namespace QSB.PoolSync
{
return;
}
_hologramGroup.SetActive(true);
var player = QSBPlayerManager.GetPlayer(playerId);
if (_playerToHologram.ContainsKey(player))
{
@ -669,7 +677,6 @@ namespace QSB.PoolSync
_playerToHologram.Add(player, hologramCopy.gameObject);
_hologramGroup.SetActive(true);
hologramCopy.gameObject.SetActive(true);
}
@ -682,12 +689,11 @@ namespace QSB.PoolSync
var player = QSBPlayerManager.GetPlayer(playerId);
if (!_playerToHologram.ContainsKey(player))
{
DebugLog.ToConsole($"Error - Trying to remove remote player {playerId} that isn't in _playerToHologram!", MessageType.Error);
return;
}
_playerToHologram[player].SetActive(false);
if (!_anyoneStillOnPlatform)
if (!_platformActive)
{
_hologramGroup.SetActive(false);
}

View File

@ -8,6 +8,7 @@ namespace QSB.PoolSync.Patches
public override void DoPatches()
{
QSBCore.HarmonyHelper.AddPrefix<NomaiRemoteCameraPlatform>("Awake", typeof(PoolPatches), nameof(ReturnFalse));
QSBCore.HarmonyHelper.AddPrefix<NomaiRemoteCameraPlatform>("Update", typeof(PoolPatches), nameof(ReturnFalse));
QSBCore.HarmonyHelper.AddPrefix<NomaiRemoteCameraPlatform>("OnSocketableRemoved", typeof(PoolPatches), nameof(ReturnFalse));
QSBCore.HarmonyHelper.AddPrefix<NomaiRemoteCameraPlatform>("OnSocketableDonePlacing", typeof(PoolPatches), nameof(ReturnFalse));
@ -21,6 +22,7 @@ namespace QSB.PoolSync.Patches
public override void DoUnpatches()
{
QSBCore.HarmonyHelper.Unpatch<NomaiRemoteCameraPlatform>("Awake");
QSBCore.HarmonyHelper.Unpatch<NomaiRemoteCameraPlatform>("Update");
QSBCore.HarmonyHelper.Unpatch<NomaiRemoteCameraPlatform>("OnSocketableRemoved");
QSBCore.HarmonyHelper.Unpatch<NomaiRemoteCameraPlatform>("OnSocketableDonePlacing");