if (item.spawnshieldtime)
{
if ((player_amount >= ammomax) && (item.pickup_anyway <= 0))
- {
return false;
- }
- GiveOrTakeResourceWithLimit(player, res_type, amount, ammomax);
- return true;
}
- if (g_weapon_stay != 2)
- {
+ else if (g_weapon_stay == 2)
+ ammomax = min(amount, ammomax);
+ else
return false;
- }
- GiveOrTakeResourceWithLimit(player, res_type, amount, min(amount, ammomax));
+ if (amount < 0)
+ TakeResourceWithLimit(player, res_type, -amount, ammomax);
+ else
+ GiveResourceWithLimit(player, res_type, amount, ammomax);
return true;
}
}
}
bool pickedup = false;
- pickedup = pickedup || Item_GiveAmmoTo(item, player, RES_HEALTH, item.max_health);
- pickedup = pickedup || Item_GiveAmmoTo(item, player, RES_ARMOR, item.max_armorvalue);
- pickedup = pickedup || Item_GiveAmmoTo(item, player, RES_SHELLS, g_pickup_shells_max);
- pickedup = pickedup || Item_GiveAmmoTo(item, player, RES_BULLETS, g_pickup_nails_max);
- pickedup = pickedup || Item_GiveAmmoTo(item, player, RES_ROCKETS, g_pickup_rockets_max);
- pickedup = pickedup || Item_GiveAmmoTo(item, player, RES_CELLS, g_pickup_cells_max);
- pickedup = pickedup || Item_GiveAmmoTo(item, player, RES_PLASMA, g_pickup_plasma_max);
- pickedup = pickedup || Item_GiveAmmoTo(item, player, RES_FUEL, g_pickup_fuel_max);
+ pickedup = (pickedup || Item_GiveAmmoTo(item, player, RES_HEALTH, item.max_health));
+ pickedup = (pickedup || Item_GiveAmmoTo(item, player, RES_ARMOR, item.max_armorvalue));
+ pickedup = (pickedup || Item_GiveAmmoTo(item, player, RES_SHELLS, g_pickup_shells_max));
+ pickedup = (pickedup || Item_GiveAmmoTo(item, player, RES_BULLETS, g_pickup_nails_max));
+ pickedup = (pickedup || Item_GiveAmmoTo(item, player, RES_ROCKETS, g_pickup_rockets_max));
+ pickedup = (pickedup || Item_GiveAmmoTo(item, player, RES_CELLS, g_pickup_cells_max));
+ pickedup = (pickedup || Item_GiveAmmoTo(item, player, RES_PLASMA, g_pickup_plasma_max));
+ pickedup = (pickedup || Item_GiveAmmoTo(item, player, RES_FUEL, g_pickup_fuel_max));
if (item.itemdef.instanceOfWeaponPickup)
{
WepSet w;
return;
}
+ precache_model(this.model);
+ precache_sound(this.item_pickupsound);
+
if (Item_IsLoot(this))
{
this.reset = SUB_Remove;
{
if(!have_pickup_item(this))
{
+ if(g_weaponarena == 2 && weaponid)
+ weaponsInMap |= WepSet_FromWeapon(Weapons_from(weaponid));
startitem_failed = true;
delete(this);
return;
weaponsInMap |= WepSet_FromWeapon(Weapons_from(weaponid));
- precache_model(this.model);
- precache_sound(this.item_pickupsound);
-
if ( def.instanceOfPowerup
|| def.instanceOfWeaponPickup
|| (def.instanceOfHealth && def != ITEM_HealthSmall)
this.ItemStatus |= ITS_ANIMATE2;
}
+ if(Item_IsLoot(this))
+ this.gravity = 1;
+
if(def.instanceOfWeaponPickup)
{
if (!Item_IsLoot(this)) // if dropped, colormap is already set up nicely
this.colormap = 1024; // color shirt=0 pants=0 grey
- else
- this.gravity = 1;
if (!(this.spawnflags & 1024))
this.ItemStatus |= ITS_ANIMATE1;
this.SendFlags |= ISF_COLORMAP;
POSTGIVE_RES_ROT(e, RES_HEALTH, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND_MEGAHEALTH, SND_Null);
if(e.superweapons_finished <= 0)
- if(STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS)
+ if(!g_weaponarena && (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
e.superweapons_finished = autocvar_g_balance_superweapons_time;
if(e.strength_finished <= 0)