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.
3341 {
3342 if (!IsServerCheck(allow_client))
3343 return false;
3344
3346 return false;
3347
3350
3351 if (value <= (min + 0.001))
3352 value = min;
3353
3354 if (value == min)
3355 {
3356 if (destroy_config)
3357 {
3358 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
3359 if (dstr)
3360 {
3362 this.Delete();
3363 return true;
3364 }
3365 }
3366 else if (destroy_forced)
3367 {
3369 this.Delete();
3370 return true;
3371 }
3372
3374 }
3375
3378
3380 {
3381 EntityAI parent = GetHierarchyRoot();
3382 InventoryLocation iLoc = new InventoryLocation();
3383 GetInventory().GetCurrentInventoryLocation(iLoc);
3385 {
3386 int iLocSlot = iLoc.
GetSlot();
3388 {
3390 }
3392 {
3394 }
3395 }
3396 }
3397
3399 {
3401
3402 if (delta)
3404 }
3405
3407
3408 return false;
3409 }
override bool IsPrepareToDelete()
InventoryLocationType
types of Inventory Location
override bool HasQuantity()
void StartItemSoundServer(int id, int slotId)
override void RemoveAllAgents()
override int GetQuantityMax()
override float GetStoreLoadedQuantity()
override int GetQuantityMin()
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
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