From: bones_was_here Date: Sun, 18 Oct 2020 02:40:08 +0000 (+1000) Subject: q3compat: Fix crash when ammo_bfg has count field set X-Git-Tag: xonotic-v0.8.5~352^2~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=171dd1260cc04a4705994e93addde1c8c2449901;p=xonotic%2Fxonotic-data.pk3dir.git q3compat: Fix crash when ammo_bfg has count field set --- diff --git a/qcsrc/server/compat/quake3.qh b/qcsrc/server/compat/quake3.qh index d6ca4fd55..55b2ede5c 100644 --- a/qcsrc/server/compat/quake3.qh +++ b/qcsrc/server/compat/quake3.qh @@ -11,7 +11,7 @@ bool DoesQ3ARemoveThisEntity(entity this); // The ammo spawnfunc knows which weapon will use the ammo so it can look up the type // and calculate the amount required for the number of shots in the count field. #define _SPAWNFUNC_Q3AMMO(ammo_classname, xonwep) \ - if(this.count) \ + if(this.count && xonwep.ammo_type) \ SetResource(this, xonwep.ammo_type, this.count * GetAmmoConsumptionPrimary(xonwep.netname)); \ spawnfunc_body(GetAmmoItem(xonwep.ammo_type));