From 66da1722cad1bff65f90e6982ec51bfdd028d3f0 Mon Sep 17 00:00:00 2001 From: BjossiAlfreds Date: Thu, 19 Sep 2019 23:36:29 +0000 Subject: [PATCH] ETF Rifle respects infinite ammo DM flag --- src/player/weapon.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/player/weapon.c b/src/player/weapon.c index e47ebcf..575da9f 100644 --- a/src/player/weapon.c +++ b/src/player/weapon.c @@ -2268,7 +2268,7 @@ weapon_etf_rifle_fire(edict_t *ent) { vec3_t forward, right, up; vec3_t start, tempPt; - int damage; + int damage = 10; int kick = 3; int i; vec3_t offset; @@ -2278,15 +2278,6 @@ weapon_etf_rifle_fire(edict_t *ent) return; } - if (deathmatch->value) - { - damage = 10; - } - else - { - damage = 10; - } - if (ent->client->pers.inventory[ent->client->ammo_index] < ent->client->pers.weapon->quantity) { VectorClear(ent->client->kick_origin); @@ -2341,7 +2332,9 @@ weapon_etf_rifle_fire(edict_t *ent) PlayerNoise(ent, start, PNOISE_WEAPON); ent->client->ps.gunframe++; - ent->client->pers.inventory[ent->client->ammo_index] -= ent->client->pers.weapon->quantity; + + if (!((int)dmflags->value & DF_INFINITE_AMMO)) + ent->client->pers.inventory[ent->client->ammo_index] -= ent->client->pers.weapon->quantity; ent->client->anim_priority = ANIM_ATTACK; @@ -2403,18 +2396,11 @@ Heatbeam_Fire(edict_t *ent) if (deathmatch->value) { damage = HEATBEAM_DM_DMG; + kick = 75; /* really knock 'em around in deathmatch */ } else { damage = HEATBEAM_SP_DMG; - } - - if (deathmatch->value) /* really knock 'em around in deathmatch */ - { - kick = 75; - } - else - { kick = 30; }