From 5aac53334f6c04b09ece932aaeda98b05168ca18 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Fri, 5 Apr 2024 12:06:22 -0700 Subject: [PATCH] Placeable mines: fix last shot switch when ammo is given during last shot fire time --- scripts/zm/reimagined/_zm_weap_bouncingbetty.gsc | 6 ++++-- scripts/zm/replaced/_zm_weap_claymore.gsc | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/zm/reimagined/_zm_weap_bouncingbetty.gsc b/scripts/zm/reimagined/_zm_weap_bouncingbetty.gsc index b6d2fbbe..d3dd9463 100644 --- a/scripts/zm/reimagined/_zm_weap_bouncingbetty.gsc +++ b/scripts/zm/reimagined/_zm_weap_bouncingbetty.gsc @@ -174,6 +174,7 @@ betty_last_shot_switch(weapname) { self endon("disconnect"); + ammo = self getammocount(weapname); fire_time = 0.8; if (self hasperk("specialty_rof")) @@ -193,14 +194,15 @@ betty_last_shot_switch(weapname) return; } - if (self getammocount(weapname) != 0) + if (ammo != 0) { return; } + ammo = self getammocount(weapname); self takeweapon(weapname); self giveweapon(weapname); - self setweaponammoclip(weapname, 0); + self setweaponammoclip(weapname, ammo); } betty_setup() diff --git a/scripts/zm/replaced/_zm_weap_claymore.gsc b/scripts/zm/replaced/_zm_weap_claymore.gsc index 7e7b4e97..43a83924 100644 --- a/scripts/zm/replaced/_zm_weap_claymore.gsc +++ b/scripts/zm/replaced/_zm_weap_claymore.gsc @@ -139,6 +139,7 @@ claymore_last_shot_switch(weapname) { self endon("disconnect"); + ammo = self getammocount(weapname); fire_time = 0.8; if (self hasperk("specialty_rof")) @@ -158,14 +159,15 @@ claymore_last_shot_switch(weapname) return; } - if (self getammocount(weapname) != 0) + if (ammo != 0) { return; } + ammo = self getammocount(weapname); self takeweapon(weapname); self giveweapon(weapname); - self setweaponammoclip(weapname, 0); + self setweaponammoclip(weapname, ammo); } claymore_detonation()