From 611e439c678c6e77055f290dd167b7509da777a6 Mon Sep 17 00:00:00 2001 From: MSWS Date: Wed, 28 Aug 2024 18:07:21 -0700 Subject: [PATCH] Avoid crashing --- mod/Jailbreak.RTD/Rewards/CannotPickupReward.cs | 2 +- public/Jailbreak.Public/Mod/SpecialDay/AbstractSpecialDay.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/Jailbreak.RTD/Rewards/CannotPickupReward.cs b/mod/Jailbreak.RTD/Rewards/CannotPickupReward.cs index 21a2bb12..0ad54e1a 100644 --- a/mod/Jailbreak.RTD/Rewards/CannotPickupReward.cs +++ b/mod/Jailbreak.RTD/Rewards/CannotPickupReward.cs @@ -49,7 +49,7 @@ private HookResult onPickup(EventItemPickup @event, GameEventInfo info) { return HookResult.Continue; var weapon = "weapon_" + @event.Item; if (!blockedWeapons.Contains(weapon)) return HookResult.Continue; - player.RemoveItemByDesignerName(weapon, true); + player.RemoveWeapons(); return HookResult.Continue; } } \ No newline at end of file diff --git a/public/Jailbreak.Public/Mod/SpecialDay/AbstractSpecialDay.cs b/public/Jailbreak.Public/Mod/SpecialDay/AbstractSpecialDay.cs index 4dcb133d..30222ac9 100644 --- a/public/Jailbreak.Public/Mod/SpecialDay/AbstractSpecialDay.cs +++ b/public/Jailbreak.Public/Mod/SpecialDay/AbstractSpecialDay.cs @@ -278,7 +278,7 @@ virtual protected HookResult OnPickup(EventItemPickup @event, var allowed = Settings.AllowedWeapons(player); var weapon = "weapon_" + @event.Item; if (allowed == null || allowed.Contains(weapon)) return HookResult.Continue; - Server.NextFrame(() => { player.RemoveItemByDesignerName(weapon); }); + Server.NextFrame(() => { player.RemoveWeapons(); }); return HookResult.Continue; }