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

◆ SetupSpawnedItem()

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

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

4932{
4933 if (item)
4934 {
4935 if (health > 0)
4936 item.SetHealth("", "", health);
4937
4938 if (item.CanHaveTemperature())
4939 {
4940 item.SetTemperatureDirect(GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE);
4941 if (item.CanFreeze())
4942 item.SetFrozen(false);
4943 }
4944
4945 if (item.HasEnergyManager())
4946 {
4947 if (quantity >= 0)
4948 {
4949 item.GetCompEM().SetEnergy0To1(quantity);
4950 }
4951 else
4952 {
4953 item.GetCompEM().SetEnergy(Math.AbsFloat(quantity));
4954 }
4955 }
4956 else if (item.IsMagazine())
4957 {
4958 Magazine mag = Magazine.Cast(item);
4959 if (quantity >= 0)
4960 {
4961 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
4962 }
4963 else
4964 {
4965 mag.ServerSetAmmoCount(Math.AbsFloat(quantity));
4966 }
4967
4968 }
4969 else
4970 {
4971 if (quantity >= 0)
4972 {
4973 item.SetQuantityNormalized(quantity, false);
4974 }
4975 else
4976 {
4977 item.SetQuantity(Math.AbsFloat(quantity));
4978 }
4979
4980 }
4981 }
4982}
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/DayZ/constants.c:811
static proto float AbsFloat(float f)
Returns absolute value.

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