4804{
4805 if (item)
4806 {
4807 if (health > 0)
4808 item.SetHealth("", "", health);
4809
4810 if (item.CanHaveTemperature())
4811 {
4813 if (item.CanFreeze())
4814 item.SetFrozen(false);
4815 }
4816
4817 if (item.HasEnergyManager())
4818 {
4819 if (quantity >= 0)
4820 {
4821 item.GetCompEM().SetEnergy0To1(quantity);
4822 }
4823 else
4824 {
4826 }
4827 }
4828 else if (item.IsMagazine())
4829 {
4830 Magazine mag = Magazine.Cast(item);
4831 if (quantity >= 0)
4832 {
4833 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
4834 }
4835 else
4836 {
4838 }
4839
4840 }
4841 else
4842 {
4843 if (quantity >= 0)
4844 {
4845 item.SetQuantityNormalized(quantity, false);
4846 }
4847 else
4848 {
4850 }
4851
4852 }
4853 }
4854}
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
static proto float AbsFloat(float f)
Returns absolute value.