Quake 2 Oop Conversion Project - Source Diff 3.05 vs 3.14 - p_weapon.c
diff -s -r q2_305/p_weapon.c q2_314/p_weapon.c
Left File < - 3.05/p_weapon.c
Right File > - 3.14/p_weapon.c
Back to Index
9a10,13
>

> void weapon_grenade_fire (edict_t *ent, qboolean held);
>
>
102c106,107
< if ( ((int)(dmflags->value) & DF_WEAPONS_STAY) && other->client->pers.inventory[index])
---
> if ( ( ((int)(dmflags->value) & DF_WEAPONS_STAY) || coop->value)
> && other->client->pers.inventory[index])
114c119,122
< Add_Ammo (other, ammo, ammo->quantity);
---
> if ( (int)dmflags->value & DF_INFINITE_AMMO )
> Add_Ammo (other, ammo, 1000);
> else
> Add_Ammo (other, ammo, ammo->quantity);
124a133,134
> if (coop->value)
> ent->flags |= FL_RESPAWN;
128a139
> (other->client->pers.inventory[index] == 1) &&
145a157,165
> if (ent->client->grenade_time)
> {
> ent->client->grenade_time = level.time;
> ent->client->weapon_sound = 0;
> weapon_grenade_fire (ent, false);
> ent->client->grenade_time = 0;
> }
>
> ent->client->pers.lastweapon = ent->client->pers.weapon;
161,162d180
< //Try changing the weapon state to WEAPON_READY
< //Constant Ready on Switch should work?
199c217
< if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("shells"))]
---
> if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("shells"))] > 1
230,236d247
< if (g_unlimited_ammo->value)
< {
< if (ent->client->ammo_index)
< ent->client->pers.inventory[ent->client->ammo_index] = 999;
< //FIXME make this be the actual max
< }
<
266c277
< if (item->ammo)
---
> if (item->ammo && !g_select_empty->value && !(item->flags & IT_AMMO))
270c281,282
< if (!ent->client->pers.inventory[ammo_index] && !g_select_empty->value)
---
>
> if (!ent->client->pers.inventory[ammo_index])
274a287,292
>
> if (ent->client->pers.inventory[ammo_index] < item->quantity)
> {
> gi.cprintf (ent, PRINT_HIGH, "Not enough %s for %s.\n", ammo_item->pickup_name, item->pickup_name);
> return;
> }
291a310,312
> if ((int)(dmflags->value) & DF_WEAPONS_STAY)
> return;
>
294c315
< if ( (item == ent->client->pers.weapon) && (ent->client->pers.inventory[index] == 1) )
---
> if ( ((item == ent->client->pers.weapon) || (item == ent->client->newweapon))&& (ent->client->pers.inventory[index] == 1) )
296c317
< gi.cprintf (ent, PRINT_HIGH, "Can't drop - Weapon is in use\n");
---
> gi.cprintf (ent, PRINT_HIGH, "Can't drop current weapon\n");
446c467
< void weapon_grenade_fire (edict_t *ent)
---
> void weapon_grenade_fire (edict_t *ent, qboolean held)
466c487
< fire_grenade2 (ent, start, forward, damage, speed, timer, radius);
---
> fire_grenade2 (ent, start, forward, damage, speed, timer, radius, held);
468c489,490
< ent->client->pers.inventory[ent->client->ammo_index]--;
---
> if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
> ent->client->pers.inventory[ent->client->ammo_index]--;
539c561
< weapon_grenade_fire (ent);
---
> weapon_grenade_fire (ent, true);
563c585
< weapon_grenade_fire (ent);
---
> weapon_grenade_fire (ent, false);
571a594,595
> {
> ent->client->grenade_time = 0;
572a597
> }
614c639,640
< 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]--;
657c683
< fire_rocket (ent, start, forward, damage, 550, damage_radius, radius_damage);
---
> fire_rocket (ent, start, forward, damage, 650, damage_radius, radius_damage);
669c695,696
< 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]--;
705c732
< fire_blaster (ent, start, forward, damage, 1000, effect);
---
> fire_blaster (ent, start, forward, damage, 1000, effect, hyper);
745a773
> int damage;
775,776c803,809
< Blaster_Fire (ent, offset, 20, true, effect);
< ent->client->pers.inventory[ent->client->ammo_index] -= ent->client->pers.weapon->quantity;
---
> if (deathmatch->value)
> damage = 15;
> else
> damage = 20;
> Blaster_Fire (ent, offset, damage, true, effect);
> if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
> ent->client->pers.inventory[ent->client->ammo_index]--;
869c902
< fire_bullet (ent, start, forward, damage, kick, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD);
---
> fire_bullet (ent, start, forward, damage, kick, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MOD_MACHINEGUN);
878c911,912
< 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]--;
978d1011
< start[2] += ent->viewheight-8;
982c1015
< fire_bullet (ent, start, forward, damage, kick, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD);
---
> fire_bullet (ent, start, forward, damage, kick, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MOD_CHAINGUN);
993c1026,1027
< ent->client->pers.inventory[ent->client->ammo_index] -= shots;
---
> if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
> ent->client->pers.inventory[ent->client->ammo_index] -= shots;
1043c1077
< fire_shotgun (ent, start, forward, damage, kick, 500, 500, DEFAULT_DEATHMATCH_SHOTGUN_COUNT);
---
> fire_shotgun (ent, start, forward, damage, kick, 500, 500, DEFAULT_DEATHMATCH_SHOTGUN_COUNT, MOD_SHOTGUN);
1045c1079
< fire_shotgun (ent, start, forward, damage, kick, 500, 500, DEFAULT_SHOTGUN_COUNT);
---
> fire_shotgun (ent, start, forward, damage, kick, 500, 500, DEFAULT_SHOTGUN_COUNT, MOD_SHOTGUN);
1056c1090,1091
< 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]--;
1095c1130
< fire_shotgun (ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT/2);
---
> fire_shotgun (ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT/2, MOD_SSHOTGUN);
1098c1133
< fire_shotgun (ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT/2);
---
> fire_shotgun (ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT/2, MOD_SSHOTGUN);
1109c1144,1145
< 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] -= 2;
1173c1209,1210
< 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]--;
1198c1235
< int damage = 500;
---
> int damage;
1200a1238,1242
> if (deathmatch->value)
> damage = 200;
> else
> damage = 500;
>
1214a1257,1264
> // cells can go down during windup (from power armor hits), so
> // check again and abort firing if we don't have enough now
> if (ent->client->pers.inventory[ent->client->ammo_index] < 50)
> {
> ent->client->ps.gunframe++;
> return;
> }
>
1235c1285,1286
< 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] -= 50;