From ff7d89aae01d432167822dafee06611b80799142 Mon Sep 17 00:00:00 2001 From: AnloGames <7383an@gmail.com> Date: Tue, 20 Aug 2024 17:20:45 +0300 Subject: [PATCH] ClientMPFix --- ZoFo/GameCore/GameObjects/Entities/Entity.cs | 5 ++++- ZoFo/GameCore/GameObjects/GameObject.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ZoFo/GameCore/GameObjects/Entities/Entity.cs b/ZoFo/GameCore/GameObjects/Entities/Entity.cs index 97630bf..fc7cea8 100644 --- a/ZoFo/GameCore/GameObjects/Entities/Entity.cs +++ b/ZoFo/GameCore/GameObjects/Entities/Entity.cs @@ -59,7 +59,10 @@ namespace ZoFo.GameCore.GameObjects public virtual void Delete() { - AppManager.Instance.server.DeleteObject(this); + if (AppManager.Instance.gamestate == GameState.HostPlaying) + { + AppManager.Instance.server.DeleteObject(this); + } } } } diff --git a/ZoFo/GameCore/GameObjects/GameObject.cs b/ZoFo/GameCore/GameObjects/GameObject.cs index 335d042..d4472b6 100644 --- a/ZoFo/GameCore/GameObjects/GameObject.cs +++ b/ZoFo/GameCore/GameObjects/GameObject.cs @@ -43,7 +43,10 @@ public abstract class GameObject public void Instantiate(GameObject gameObject) { - AppManager.Instance.server.RegisterGameObject(gameObject); + if (AppManager.Instance.gamestate == GameState.HostPlaying) + { + AppManager.Instance.server.RegisterGameObject(gameObject); + } } #endregion