From f963d81001b4fa715abb44610e1126c303304a21 Mon Sep 17 00:00:00 2001 From: Beu Date: Sat, 2 Dec 2023 20:34:22 +0100 Subject: [PATCH] fix crash when player spawn before being added --- TM_WaitYourMate.Script.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TM_WaitYourMate.Script.txt b/TM_WaitYourMate.Script.txt index 191b835..f64fb05 100644 --- a/TM_WaitYourMate.Script.txt +++ b/TM_WaitYourMate.Script.txt @@ -13,14 +13,13 @@ foreach (Event in PendingEvents) { if (Event.Type == CSmModeEvent::EType::OnPlayerAdded) { if (S_TeamsConfig == "") continue; if (Event.Player == Null || Event.Player.User == Null || Event.Player.Score == Null) continue; - if (Event.Player.SpawnStatus == CSmPlayer::ESpawnStatus::Spawned) continue; declare Integer[Text] TeamsConfig; TeamsConfig.fromjson(S_TeamsConfig); declare Integer ClanId = TeamsConfig.get(Event.Player.User.WebServicesUserId, 0); Event.Player.Score.LadderClan = ClanId; - SetPlayerClan(Event.Player, ClanId); + if (Event.Player.SpawnStatus == CSmPlayer::ESpawnStatus::NotSpawned) SetPlayerClan(Event.Player, ClanId); log("Attributing Player "^ Event.Player.User.Name ^"to the clan " ^ ClanId); } }