]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
q3compat: Fix crash when ammo_bfg has count field set
authorbones_was_here <bones_was_here@xa.org.au>
Sun, 18 Oct 2020 02:40:08 +0000 (12:40 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Sun, 18 Oct 2020 02:40:08 +0000 (12:40 +1000)
qcsrc/server/compat/quake3.qh

index d6ca4fd55f7948ba50eee7b8fa637368b1174c41..55b2ede5cb7044b38e622ff51365e71c00d36781 100644 (file)
@@ -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));