From 62788435d46b3088e33add2d3f6303a24eeffd4b Mon Sep 17 00:00:00 2001 From: Jackz Date: Fri, 18 Jun 2021 23:48:59 -0500 Subject: [PATCH] epi: Up players active ammo on ammo pack use --- scripting/l4d2_extraplayeritems.sp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripting/l4d2_extraplayeritems.sp b/scripting/l4d2_extraplayeritems.sp index 978e3ff..7b423b9 100644 --- a/scripting/l4d2_extraplayeritems.sp +++ b/scripting/l4d2_extraplayeritems.sp @@ -228,7 +228,7 @@ public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadca if(firstSaferoomDoorEntity > 0 && percentIn > hMinPlayersSaferoomDoor.FloatValue) { UnlockDoor(firstSaferoomDoorEntity, 2); } - }else{ + }else if(firstSaferoomDoorEntity > 0) { UnlockDoor(firstSaferoomDoorEntity, 2); } } @@ -481,7 +481,9 @@ public Action OnUpgradePackUse(int entity, int activator, int caller, UseType ty if(clients.Length == 0) { CreateTimer(60.0, Timer_ResetAmmoPack, entity); } - + if(GetEntProp(primaryWeapon, Prop_Send, "m_iClip1") < ammo) { + SetEntProp(primaryWeapon, Prop_Send, "m_iClip1", ammo); + } SetEntProp(primaryWeapon, Prop_Send, "m_nUpgradedPrimaryAmmoLoaded", ammo); clients.Push(activator); ClientCommand(activator, "play player/orch_hit_csharp_short.wav");