From a80def1d12cbf0ae601d4cd0328c42b0106b4eab Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sun, 12 Dec 2021 20:36:11 -0800 Subject: [PATCH] Server: Fix that you're unable to pick up weapons when you've hit the ammo cap of said weapon. --- src/gs-entbase/shared/NSSurfacePropEntity.qc | 6 ++---- src/server/weapons.qc | 11 +++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gs-entbase/shared/NSSurfacePropEntity.qc b/src/gs-entbase/shared/NSSurfacePropEntity.qc index 718354f3..3960567c 100644 --- a/src/gs-entbase/shared/NSSurfacePropEntity.qc +++ b/src/gs-entbase/shared/NSSurfacePropEntity.qc @@ -63,7 +63,6 @@ NSSurfacePropEntity::ParentUpdate(void) NSRenderableEntity::ParentUpdate(); } - /* Burning, fire, flames, etc. */ void NSSurfacePropEntity::Ignite(entity attacker, float flLifetime, int iWeapon) @@ -73,6 +72,7 @@ NSSurfacePropEntity::Ignite(entity attacker, float flLifetime, int iWeapon) m_iBurnWeapon = iWeapon; m_flBurnTime = time + flLifetime; } + void NSSurfacePropEntity::Extinguish(void) { @@ -81,6 +81,7 @@ NSSurfacePropEntity::Extinguish(void) m_iBurnWeapon = m_flBurnTime = 0; } + int NSSurfacePropEntity::IsOnFire(void) { @@ -169,7 +170,6 @@ NSSurfacePropEntity::Input(entity eAct, string strInput, string strData) default: NSRenderableEntity::Input(eAct, strInput, strData); } - } void @@ -252,7 +252,6 @@ NSSurfacePropEntity::PropDataFinish(void) PropData_SetStage(m_strPropData); m_iPropData = PropData_Finish(); } - #endif void @@ -267,7 +266,6 @@ NSSurfacePropEntity::SetModel(string newModel) #endif } - void NSSurfacePropEntity::NSSurfacePropEntity(void) { diff --git a/src/server/weapons.qc b/src/server/weapons.qc index e79878c3..3faddb67 100644 --- a/src/server/weapons.qc +++ b/src/server/weapons.qc @@ -156,18 +156,17 @@ Weapons_AddItem(base_player pl, int w, int startammo) } else { /* call pickup to handle the ammo */ if (pl.g_items & g_weapons[w].id) { + /* we have the item already, se let's see if we hit maxammo */ value = g_weapons[w].pickup(FALSE, startammo); + /* FALSE means maxammo is hit */ if (!value) return value; } else { - /* new to our arsenal */ - value = g_weapons[w].pickup(TRUE, startammo); - - if (!value) - return value; - + /* new to our arsenal, so always return TRUE */ + g_weapons[w].pickup(TRUE, startammo); pl.g_items |= g_weapons[w].id; + value = TRUE; /* it's new, so autoswitch? */ if (pl.activeweapon == 0 && autocvar_sv_forceweapondraw == 1) {