Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity reaches varQuantityMin or lower and the item config contains the varQuantityDestroyOnMin = true entry, the item gets destroyed. destroy_forced = true means item gets destroyed when quantity reaches varQuantityMin or lower regardless of config setting, returns true if the item gets deleted.
3316 {
3317 if (!IsServerCheck(allow_client))
3318 return false;
3319
3321 return false;
3322
3325
3326 if (value <= (min + 0.001))
3327 value = min;
3328
3329 if (value == min)
3330 {
3331 if (destroy_config)
3332 {
3333 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
3334 if (dstr)
3335 {
3337 this.Delete();
3338 return true;
3339 }
3340 }
3341 else if (destroy_forced)
3342 {
3344 this.Delete();
3345 return true;
3346 }
3347
3349 }
3350
3353
3354 EntityAI parent = GetHierarchyRoot();
3357 if (gameInventory)
3358 {
3361 {
3362 int iLocSlot = iLoc.
GetSlot();
3364 {
3366 }
3368 {
3370 }
3371 }
3372 }
3373
3375 {
3377
3378 if (delta)
3380 }
3381
3383
3384 return false;
3385 }
override bool IsPrepareToDelete()
InventoryLocationType
types of Inventory Location
override int GetQuantityMin()
override void RemoveAllAgents()
override bool HasQuantity()
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void StartItemSoundServer(int id, int slotId)
override float GetStoreLoadedQuantity()
override int GetQuantityMax()
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
script counterpart to engine's class Inventory
proto native bool IsValid()
verify current set inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation
const int VARIABLE_QUANTITY
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.