game: fix pickup chainfist

This commit is contained in:
Denis Pauk 2024-12-21 23:09:39 +02:00
parent 27d1a87ab0
commit 14a832c710
2 changed files with 23 additions and 13 deletions

View file

@ -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);
}
/*

View file

@ -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))