Skip to content

Commit

Permalink
Avoid crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Aug 29, 2024
1 parent f68f23a commit 611e439
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mod/Jailbreak.RTD/Rewards/CannotPickupReward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 611e439

Please sign in to comment.