From 8e10c00c244874523baaee79243900faa9112637 Mon Sep 17 00:00:00 2001 From: Antoniofo Date: Mon, 23 Dec 2024 12:53:28 +0100 Subject: [PATCH] fix upgradeplayer #2 using the nullchecker with ignoredRooms so Count is not call on the variable while is null --- Common Utilities/EventHandlers/MapHandlers.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common Utilities/EventHandlers/MapHandlers.cs b/Common Utilities/EventHandlers/MapHandlers.cs index f1dc0fc..50da8ad 100644 --- a/Common Utilities/EventHandlers/MapHandlers.cs +++ b/Common Utilities/EventHandlers/MapHandlers.cs @@ -216,8 +216,8 @@ public void OnUpgradingPlayer(UpgradingPlayerEventArgs ev) double rolledChance = Utils.RollChance(scp914TeleportChances); foreach ((RoomType roomType, List ignoredRooms, Vector3 offset, double chance, float damage, ZoneType zone) in config.Scp914TeleportChances[ev.KnobSetting]) - { - Log.Debug($"{nameof(OnUpgradingPlayer)} : {nameof(config.Scp914TeleportChances)}: {ev.Player.Nickname} is trying to be teleported by 914. {roomType} + {offset}; {zone} + {ignoredRooms.Count} ignored rooms; damage: {damage}; {rolledChance} <= {chance} ({rolledChance <= chance})"); + { + Log.Debug($"{nameof(OnUpgradingPlayer)} : {nameof(config.Scp914TeleportChances)}: {ev.Player.Nickname} is trying to be teleported by 914. {roomType} + {offset}; {zone} + {ignoredRooms?.Count} ignored rooms; damage: {damage}; {rolledChance} <= {chance} ({rolledChance <= chance})"); if (rolledChance <= chance) {