4876{
4877 if (item)
4878 {
4879 if (health > 0)
4880 item.SetHealth("", "", health);
4881
4882 if (item.CanHaveTemperature())
4883 {
4885 if (item.CanFreeze())
4886 item.SetFrozen(false);
4887 }
4888
4889 if (item.HasEnergyManager())
4890 {
4891 if (quantity >= 0)
4892 {
4893 item.GetCompEM().SetEnergy0To1(quantity);
4894 }
4895 else
4896 {
4898 }
4899 }
4900 else if (item.IsMagazine())
4901 {
4902 Magazine mag = Magazine.Cast(item);
4903 if (quantity >= 0)
4904 {
4905 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
4906 }
4907 else
4908 {
4910 }
4911
4912 }
4913 else
4914 {
4915 if (quantity >= 0)
4916 {
4917 item.SetQuantityNormalized(quantity, false);
4918 }
4919 else
4920 {
4922 }
4923
4924 }
4925 }
4926}
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.