mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-03-14 23:12:41 +00:00
game: fix pickup chainfist
This commit is contained in:
parent
27d1a87ab0
commit
14a832c710
2 changed files with 23 additions and 13 deletions
|
@ -600,7 +600,7 @@ ED_ParseField(const char *key, const char *value, edict_t *ent)
|
|||
}
|
||||
}
|
||||
|
||||
gi.dprintf("%s is not a field. Value is %s\n", key, value);
|
||||
gi.dprintf("'%s' is not a field. Value is '%s'\n", key, value);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -379,7 +379,6 @@ qboolean
|
|||
Pickup_Weapon(edict_t *ent, edict_t *other)
|
||||
{
|
||||
int index;
|
||||
gitem_t *ammo;
|
||||
|
||||
if (!ent || !other)
|
||||
{
|
||||
|
@ -402,18 +401,29 @@ Pickup_Weapon(edict_t *ent, edict_t *other)
|
|||
|
||||
if (!(ent->spawnflags & DROPPED_ITEM))
|
||||
{
|
||||
/* give them some ammo with it */
|
||||
ammo = FindItem(ent->item->ammo);
|
||||
if (ent->item->ammo)
|
||||
{
|
||||
gitem_t *ammo;
|
||||
|
||||
/* Don't get infinite ammo with trap */
|
||||
if (((int)dmflags->value & DF_INFINITE_AMMO) &&
|
||||
Q_stricmp(ent->item->pickup_name, "ammo_trap"))
|
||||
{
|
||||
Add_Ammo(other, ammo, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
Add_Ammo(other, ammo, ammo->quantity);
|
||||
/* give them some ammo with it */
|
||||
ammo = FindItem(ent->item->ammo);
|
||||
if (!ammo)
|
||||
{
|
||||
gi.dprintf("Ammo %s for item %s has not be found\n",
|
||||
ent->item->ammo, ent->item->classname);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Don't get infinite ammo with trap */
|
||||
if (((int)dmflags->value & DF_INFINITE_AMMO) &&
|
||||
Q_stricmp(ent->item->pickup_name, "ammo_trap"))
|
||||
{
|
||||
Add_Ammo(other, ammo, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
Add_Ammo(other, ammo, ammo->quantity);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(ent->spawnflags & DROPPED_PLAYER_ITEM))
|
||||
|
|
Loading…
Reference in a new issue