From 9fa3b8d752cb45fcb7f89eccfbf43032b32f96eb Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 26 Jun 2017 21:51:33 +1000 Subject: [PATCH] Hacky fix for players not spawning in CTF. (Thanks VenkSociety) all games code really needs a rewrite --- MCGalaxy/Games/CTF/CtfGame.cs | 10 ++++++++++ MCGalaxy/Player/PlayerActions.cs | 1 + 2 files changed, 11 insertions(+) diff --git a/MCGalaxy/Games/CTF/CtfGame.cs b/MCGalaxy/Games/CTF/CtfGame.cs index ae97019eb..38b172738 100644 --- a/MCGalaxy/Games/CTF/CtfGame.cs +++ b/MCGalaxy/Games/CTF/CtfGame.cs @@ -275,6 +275,16 @@ namespace MCGalaxy.Games { zline = mainlevel.Length / 2; } + internal void SpawnPlayer(Player p) { + if (p.level != mainlevel) return; + + if (GetPlayer(p).blue) { + bluebase.SendToSpawn(mainlevel, this, p); + } else { + redbase.SendToSpawn(mainlevel, this, p); + } + } + string Vote() { started = false; diff --git a/MCGalaxy/Player/PlayerActions.cs b/MCGalaxy/Player/PlayerActions.cs index 5714d4002..901809ad0 100644 --- a/MCGalaxy/Player/PlayerActions.cs +++ b/MCGalaxy/Player/PlayerActions.cs @@ -122,6 +122,7 @@ namespace MCGalaxy { internal static void CheckGamesJoin(Player p, Level oldLvl) { Server.lava.PlayerJoinedLevel(p, p.level, oldLvl); Server.zombie.PlayerJoinedLevel(p, p.level, oldLvl); + if (Server.ctf != null) Server.ctf.SpawnPlayer(p); if (p.inTNTwarsMap) p.canBuild = true; TntWarsGame game = TntWarsGame.Find(p.level);