if (item.spawnshieldtime)
{
if ((player_amount >= ammomax) && (item.pickup_anyway <= 0))
- {
return false;
- }
- if (amount < 0)
- TakeResourceWithLimit(player, res_type, -amount, ammomax);
- else
- GiveResourceWithLimit(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;
- }
if (amount < 0)
- TakeResourceWithLimit(player, res_type, -amount, min(amount, ammomax));
+ TakeResourceWithLimit(player, res_type, -amount, ammomax);
else
- GiveResourceWithLimit(player, res_type, amount, min(amount, ammomax));
+ GiveResourceWithLimit(player, res_type, amount, ammomax);
return true;
}