DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetupSpawnedItem()

void SetupSpawnedItem ( ItemBase item,
float health,
float quantity )

См. определение в файле ItemBase.c строка 4875

4876{
4877 if (item)
4878 {
4879 if (health > 0)
4880 item.SetHealth("", "", health);
4881
4882 if (item.CanHaveTemperature())
4883 {
4884 item.SetTemperatureDirect(GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE);
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 {
4897 item.GetCompEM().SetEnergy(Math.AbsFloat(quantity));
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 {
4909 mag.ServerSetAmmoCount(Math.AbsFloat(quantity));
4910 }
4911
4912 }
4913 else
4914 {
4915 if (quantity >= 0)
4916 {
4917 item.SetQuantityNormalized(quantity, false);
4918 }
4919 else
4920 {
4921 item.SetQuantity(Math.AbsFloat(quantity));
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)
Определения PileOfWoodenPlanks.c:88
Определения EnMath.c:7
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
Определения 3_Game/constants.c:808
static proto float AbsFloat(float f)
Returns absolute value.

Используется в PluginBase::SetupSpawnedEntity(), PluginBase::SpawnEntityAsAttachment(), PluginBase::SpawnEntityInInventory() и PluginBase::SpawnEntityInPlayerInventory().