PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
GameInventory Class Reference

script counterpart to engine's class Inventory More...

Private Member Functions

proto native bool GetCurrentInventoryLocation (out notnull InventoryLocation loc)
 returns information about current item location
 
proto native bool FindFreeLocationFor (notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
 FindFreeLocationFor.
 
proto native bool FindFreeLocationForEx (notnull EntityAI item, FindInventoryLocationType flags, notnull InventoryLocation exclude, out notnull InventoryLocation loc)
 FindFreeLocationForEx.
 
proto native bool FindFirstFreeLocationForNewEntity (string item_type, FindInventoryLocationType flags, out notnull InventoryLocation loc)
 FindFirstFreeLocationForNewEntity.
 
proto native int FindFreeLocationsFor (notnull EntityAI item, FindInventoryLocationType flags, out notnull array< ref InventoryLocation > locs)
 searches inventory for suitable location for @item
 
bool IsInCargo ()
 Returns true if this Inventory owner is in cargo of something.
 
bool IsAttachment ()
 Returns true if this Inventory owner is an attachment of something.
 
bool IsCargoInHiearchy ()
 Returns true if inventory owner or his hiearchy parents are in cargo.
 
bool AreChildrenAccessible ()
 Returns true if item is considered reachable within inventory.
 
bool GetCurrentAttachmentSlotInfo (out int slot_id, out string slot_name)
 Returns true if the item is currently attached and outputs attachment slot id and name.
 
proto native bool CanAddSwappedEntity (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
 
void OnInventoryFailure (InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
 
bool TakeEntityToInventory (InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
 Put item anywhere into this entity (as attachment or into cargo, recursively)
 
bool TakeEntityToTargetInventory (InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
 helper that finds location first, then moves the entity into it
 
bool TakeToDst (InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
 move src to dst
 
bool TakeEntityToCargo (InventoryMode mode, notnull EntityAI item)
 moves item to cargo of this intentory
 
bool TakeEntityToTargetCargo (InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
 Put item into into cargo of another entity.
 
bool TakeEntityToCargoEx (InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
 moves item on specific cargo location
 
bool TakeEntityToTargetCargoEx (InventoryMode mode, notnull CargoBase cargo, notnull EntityAI item, int row, int col)
 Put item into into cargo on specific cargo location of another entity.
 
bool TakeEntityAsAttachmentEx (InventoryMode mode, notnull EntityAI item, int slot)
 
bool TakeEntityAsTargetAttachmentEx (InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
 put item as attachment of target
 
bool TakeEntityAsAttachment (InventoryMode mode, notnull EntityAI item)
 
bool TakeEntityAsTargetAttachment (InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
 
bool SwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
 
bool ForceSwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
 
bool DropEntity (InventoryMode mode, EntityAI owner, notnull EntityAI item)
 
bool DropEntityWithTransform (InventoryMode mode, EntityAI owner, notnull EntityAI item, vector transform[4])
 
bool DropEntityInBounds (InventoryMode mode, EntityAI owner, notnull EntityAI item, vector halfExtents, float angle, float cosAngle, float sinAngle)
 
bool LocalDestroyEntity (notnull EntityAI item)
 
bool ReplaceItemWithNew (InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
 
proto native bool GetFlipCargo ()
 
proto native void SetFlipCargo (bool flip)
 
proto native void FlipCargo ()
 
proto native void ResetFlipCargo ()
 
proto native EntityAI GetInventoryOwner ()
 Engine native functions.
 
proto native bool HasEntityInInventory (notnull EntityAI item)
 query inventory if item is somewhere
 
proto native bool EnumerateInventory (InventoryTraversalType tt, out array< EntityAI > items)
 enumerate inventory using traversal type and filling items array
 
proto native int CountInventory ()
 almost identical to EnumerateInventory except it does not return items
 
proto native CargoBase GetCargo ()
 cargo
 
proto native CargoBase GetCargoFromIndex (int index)
 
proto native EntityAI CreateEntityInCargo (string typeName)
 Create Entity of specified type in cargo of entity.
 
proto native EntityAI CreateEntityInCargoEx (string typeName, int idx, int row, int col, bool flip)
 Create Entity of specified type in cargo of entity at coordinates (row, col)
 
proto native bool HasEntityInCargo (notnull EntityAI e)
 
proto native bool HasEntityInCargoEx (notnull EntityAI e, int idx, int row, int col)
 
proto native bool CanAddEntityInCargo (notnull EntityAI e, bool flip)
 
proto native bool CanAddEntityInCargoEx (notnull EntityAI e, int idx, int row, int col, bool flip)
 
proto native bool CanAddEntityInCargoExLoc (InventoryLocation loc)
 
proto native bool TestAddEntityInCargoEx (notnull EntityAI e, int idx, int row, int col, bool flip, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
 
proto native bool TestAddEntityInCargoExLoc (notnull InventoryLocation loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
 
proto native bool CanRemoveEntityInCargo (notnull EntityAI e)
 
proto native bool CanRemoveEntityInCargoEx (notnull EntityAI e, int idx, int row, int col)
 
proto native int GetSlotId (int index)
 attachments
 
proto native int GetSlotIdCount ()
 
proto native int GetAttachmentSlotId (int index)
 
proto native int GetAttachmentSlotsCount ()
 
bool HasAttachmentSlot (int slotId)
 
proto native bool HasInventorySlot (int slotId)
 
proto native int AttachmentCount ()
 Returns count of attachments attached to this item.
 
proto native EntityAI CreateAttachment (string typeName)
 Create Entity of specified type as attachment of entity.
 
proto native EntityAI CreateAttachmentEx (string typeName, int slotId)
 Create Entity of specified type as attachment of entity.
 
proto native EntityAI GetAttachmentFromIndex (int index)
 
proto native EntityAI FindAttachment (int slot)
 Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
 
proto native EntityAI FindAttachmentByName (string slotName)
 Returns attached entity in slot (you can use EntityAI.GetActionComponentName to get slot id)
 
proto native bool HasAttachment (notnull EntityAI e)
 brief Returns True if entity is attached to this
 
proto native bool HasAttachmentEx (notnull EntityAI e, int slot)
 brief Returns True if entity is attached to this in slot
 
proto native bool CanAddAttachment (notnull EntityAI e)
 Check if attachment can be added to any slot.
 
proto native bool CanAddAttachmentEx (notnull EntityAI e, int slot)
 Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID! Slot ID is defined in DZ/data/config.cpp.
 
proto native bool CanRemoveAttachment (EntityAI attachment)
 
proto native bool CanRemoveAttachmentEx (EntityAI attachment, int slot)
 
proto native EntityAI FindPlaceholderForSlot (int slot)
 Returns placeholder entity for slot (naked arms, legs etc)
 
proto native bool IsPlaceholderEntity (notnull Object e)
 
proto native bool CanLockInventoryWithKey (notnull EntityAI key)
 locks
 
proto native bool CanUnlockInventoryWithKey (notnull EntityAI key)
 
proto native void LockInventoryWithKey (notnull EntityAI key)
 
proto native void UnlockInventoryWithKey (notnull EntityAI key)
 
proto native bool HasKeys ()
 
proto native void LockInventory (int lockType)
 
proto native void UnlockInventory (int lockType)
 
proto native int GetScriptLockCount ()
 
proto native bool IsInventoryUnlocked ()
 
proto native bool IsInventoryLocked ()
 
proto native bool IsInventoryLockedForLockType (int lockType)
 
proto native bool SetSlotLock (int slot, bool locked)
 
proto native bool GetSlotLock (int slot)
 
void Init ()
 script functions
 
bool OnStoreLoad (ParamsReadContext ctx, int version)
 db load hooks
 
void OnAfterStoreLoad ()
 
void OnStoreSave (ParamsWriteContext ctx)
 db store hook
 
void EEInit ()
 
void EEDelete (EntityAI parent)
 
EntityAI CreateInInventory (string type)
 creates entity somewhere in inventory
 
bool CanAddEntityToInventory (notnull EntityAI item, int flag=FindInventoryLocationType.ANY)
 ask inventory if item could be placed somewhere in inventory
 
bool AddEntityToInventory (notnull EntityAI item)
 add entity somewhere in inventory
 
bool CanRemoveEntity ()
 Returns if entity can be removed from its current location.
 
bool CanAddEntityInto (notnull EntityAI item, FindInventoryLocationType flags=FindInventoryLocationType.ANY)
 Asks inventory if item could be placed in inventory, hands, etc.
 
bool CanAddEntityIntoInventory (notnull EntityAI item)
 Test if entity can be put to the inventory (Cargo, ProxyCargo, Attachment)
 
bool CanAddEntityIntoHands (notnull EntityAI item)
 Test if entity can be put into hands.
 
bool OnInputUserDataProcess (ParamsReadContext ctx)
 synchronization
 
bool OnInventoryJunctureFromServer (ParamsReadContext ctx)
 
bool OnInventoryJunctureRepairFromServer (ParamsReadContext ctx)
 
void OnInventoryJunctureFailureFromServer (ParamsReadContext ctx)
 
void OnServerInventoryCommand (ParamsReadContext ctx)
 

Static Private Member Functions

static proto native EntityAI LocationCreateEntity (notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
 creates new item directly at location
 
static proto native EntityAI LocationCreateLocalEntity (notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
 creates new local item directly at location @NOTE: the item is created localy, i.e. it's not registered to network
 
static proto native bool LocationCanAddEntity (notnull InventoryLocation inv_loc)
 queries if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...
 
static bool LocationCanAddEntityEx (notnull InventoryLocation inv_loc)
 
static proto native bool LocationTestAddEntity (notnull InventoryLocation inv_loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
 test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...
 
static proto native bool LocationCanRemoveEntity (notnull InventoryLocation inv_loc)
 queries if the entity contained in inv_loc.m_item can be removed from ground/attachment/cargo/hands/...
 
static proto native bool LocationCanMoveEntity (notnull InventoryLocation src, notnull InventoryLocation dst)
 queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthand for CanRemove + CanAdd query
 
static int GetInventoryCheckContext ()
 
static bool LocationCanMoveEntitySyncCheck (notnull InventoryLocation src, notnull InventoryLocation dst)
 
static proto native EntityAI LocationGetEntity (notnull InventoryLocation inv_loc)
 
static void OnServerInventoryCommandStatic (ParamsReadContext ctx)
 
static proto native bool LocationAddEntity (notnull InventoryLocation inv_loc)
 adds item to inventory location
 
static proto native bool LocationRemoveEntity (notnull InventoryLocation inv_loc)
 removes item from inventory location
 
static proto native bool LocationMoveEntity (notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
 removes item from current inventory location and adds it to destination
 
static proto native bool LocationSyncMoveEntity (notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
 synchronously removes item from current inventory location and adds it to destination no anims involved
 
static proto native bool LocationSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
 swaps two entities
 
static proto native bool ServerLocationMoveEntity (notnull EntityAI item, ParamsWriteContext ctx)
 removes item from current inventory location and adds it to destination + sync via inventory command
 
static proto native bool ServerLocationSyncMoveEntity (Man player, notnull EntityAI item, ParamsWriteContext ctx)
 synchronously removes item from current inventory location and adds it to destination + sync via inventory command no anims involved
 
static proto native bool ServerLocationSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, ParamsWriteContext ctx)
 swaps two entities
 
static proto native bool ServerHandEvent (notnull Man player, notnull EntityAI item, ParamsWriteContext ctx)
 hand event to clients
 
static proto native bool PrepareDropEntityPos (EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
 Finds a transformation for the item to be dropped to If the initial transforation overlaps with another conflicting entity (i.e. car) then the transform will be snapped to the nearest outer edge. If no valid snapping transformation could be found, then the output from 'PlaceOnSurface' is used.
 
static proto native bool TestDropEntityPos (EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
 
static proto native bool CanSwapEntities (notnull EntityAI item1, notnull EntityAI item2)
 test if ordinary swap can be performed.
 
static bool CanSwapEntitiesEx (notnull EntityAI item1, notnull EntityAI item2)
 
static proto native bool CanForceSwapEntities (notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
 test if forced swap can be performed.
 
static bool CanForceSwapEntitiesEx (notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
 
static bool MakeDstForSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
 helper function for swap
 
static bool MakeSrcAndDstForSwap (notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
 helper function for swap
 
static bool MakeSrcAndDstForForceSwap (notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, notnull InventoryLocation dst2)
 helper function for ForceSwap
 
static bool SetGroundPosByOwner (EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
 
static bool SetGroundPosByTransform (EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector transform[4])
 
static void SetGroundPosByOwnerBounds (EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector halfExtents, float angle, float cosAngle, float sinAngle)
 

Static Private Attributes

static protected int m_inventory_check_context = InventoryCheckContext.DEFAULT
 
const int c_InventoryReservationTimeoutMS = 5000
 reservations
 
const int c_InventoryReservationTimeoutShortMS = 3000
 
bool AddInventoryReservationEx (EntityAI item, InventoryLocation dst, int timeout_ms)
 
bool ExtendInventoryReservationEx (EntityAI item, InventoryLocation dst, int timeout_ms)
 
bool ClearInventoryReservationEx (EntityAI item, InventoryLocation dst)
 
proto native int GetAnyInventoryReservationCount ()
 
static proto native bool AddInventoryReservation (EntityAI item, InventoryLocation dst, int timeout_ms)
 
static proto native bool ExtendInventoryReservation (EntityAI item, InventoryLocation dst, int timeout_ms)
 
static proto native bool ClearInventoryReservation (EntityAI item, InventoryLocation dst)
 
static proto native bool HasInventoryReservation (EntityAI item, InventoryLocation dst)
 Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY, FindInventoryReservationMode.LEGACY)
 
static proto native bool HasInventoryReservationCanAdd (EntityAI item, InventoryLocation dst)
 Internally: !HasInventoryReservationEx(item, dst, FindInventoryReservationMode.ITEM, FindInventoryReservationMode.DST)
 
static proto native bool HasInventoryReservationEx (EntityAI item, InventoryLocation dst, FindInventoryReservationMode itemMode, FindInventoryReservationMode parentMode)
 itemMode will iterate over item reservations, parentMode will iterate over parent reservations
 
static proto native bool GetInventoryReservationCount (EntityAI item, InventoryLocation dst)
 
const float c_MaxItemDistanceRadius = 2.5
 anti-cheats
 
static proto native bool CheckRequestSrc (notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
 
static proto native bool CheckDropRequest (notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
 
static proto native bool CheckTakeItemRequest (notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
 
static proto native bool CheckMoveToDstRequest (notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
 
static proto native bool CheckSwapItemsRequest (notnull Man requestingPlayer, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius)
 
static proto native bool CheckManipulatedObjectsDistances (notnull EntityAI e0, notnull EntityAI e1, float radius)
 

Detailed Description

script counterpart to engine's class Inventory

Member Function Documentation

◆ AddEntityToInventory()

AddEntityToInventory ( notnull EntityAI  item)
inlineprivate

add entity somewhere in inventory

All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.

@NOTE: AddEntityToInventory does not perform the checks the CanAddEntityToInventory does (script conditions for example). if not sure, always call CanAddEntityToInventory before AddEntityToInventory.

Parameters
[in]itemitem to be placed in inventory
Returns
true if item can be added, false otherwise

References FindFreeLocationFor(), and LocationAddEntity().

◆ AddInventoryReservation()

static proto native bool AddInventoryReservation ( EntityAI  item,
InventoryLocation  dst,
int  timeout_ms 
)
staticprivate

◆ AddInventoryReservationEx()

◆ AreChildrenAccessible()

bool AreChildrenAccessible ( )
inlineprivate

Returns true if item is considered reachable within inventory.

References ErrorEx, and GetInventoryOwner().

◆ AttachmentCount()

AttachmentCount ( )
private

Returns count of attachments attached to this item.

Referenced by GetClosestCarWheel(), and ClosableContainer::RecomputeContainers().

◆ CanAddAttachment()

CanAddAttachment ( notnull EntityAI  e)
private

Check if attachment can be added to any slot.

Returns
true if entity can be added as attachment

Referenced by ActionAttachOnSelection::FindSlotIdToAttachOrCombine().

◆ CanAddAttachmentEx()

CanAddAttachmentEx ( notnull EntityAI  e,
int  slot 
)
private

Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID! Slot ID is defined in DZ/data/config.cpp.

◆ CanAddEntityInCargo()

proto native bool CanAddEntityInCargo ( notnull EntityAI  e,
bool  flip 
)
private

◆ CanAddEntityInCargoEx()

proto native bool CanAddEntityInCargoEx ( notnull EntityAI  e,
int  idx,
int  row,
int  col,
bool  flip 
)
private

◆ CanAddEntityInCargoExLoc()

proto native bool CanAddEntityInCargoExLoc ( InventoryLocation  loc)
private

◆ CanAddEntityInto()

CanAddEntityInto ( notnull EntityAI  item,
FindInventoryLocationType  flags = FindInventoryLocationType.ANY 
)
inlineprivate

Asks inventory if item could be placed in inventory, hands, etc.

Location is based on the flags parameter. This method is used in methods that are asking for if item can be placed in specific location, like CanAddEntityToInventory, CanAddEntityInHands, etc.

Parameters
[in]itemitem to be placed in inventory
[in]flagsFindInventoryLocationType
Returns
true if item can be added, false otherwise

References FindFreeLocationFor().

Referenced by CanAddEntityIntoHands(), and CanAddEntityIntoInventory().

◆ CanAddEntityIntoHands()

bool CanAddEntityIntoHands ( notnull EntityAI  item)
inlineprivate

Test if entity can be put into hands.

References CanAddEntityInto().

◆ CanAddEntityIntoInventory()

bool CanAddEntityIntoInventory ( notnull EntityAI  item)
inlineprivate

Test if entity can be put to the inventory (Cargo, ProxyCargo, Attachment)

References CanAddEntityInto().

◆ CanAddEntityToInventory()

CanAddEntityToInventory ( notnull EntityAI  item,
int  flag = FindInventoryLocationType.ANY 
)
inlineprivate

ask inventory if item could be placed somewhere in inventory

All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.

Parameters
[in]itemitem to be placed in inventory
Returns
true if item can be added, false otherwise

References FindFreeLocationFor().

◆ CanAddSwappedEntity()

proto native bool CanAddSwappedEntity ( notnull InventoryLocation  src1,
notnull InventoryLocation  src2,
notnull InventoryLocation  dst1,
notnull InventoryLocation  dst2 
)
private

◆ CanForceSwapEntities()

CanForceSwapEntities ( notnull EntityAI  item1,
InventoryLocation  item1_dst,
notnull EntityAI  item2,
out InventoryLocation  item2_dst 
)
staticprivate

test if forced swap can be performed.

Parameters
[in]item1is the forced item (primary)
[in]item1_dstoptional destination for item1 (null if item1 goes to place of item2)
[in]item2second item that will be replaced by the item1. (secondary)
[out]item2_dstsecond item's potential destination (if null, search for item_dst2 is ommited). if (NOT null AND IsValid()), then it is tried first, without search to inventory
Returns
true if can be force swapped

Referenced by CanForceSwapEntitiesEx().

◆ CanForceSwapEntitiesEx()

◆ CanLockInventoryWithKey()

proto native bool CanLockInventoryWithKey ( notnull EntityAI  key)
private

locks

◆ CanRemoveAttachment()

proto native bool CanRemoveAttachment ( EntityAI  attachment)
private

◆ CanRemoveAttachmentEx()

proto native bool CanRemoveAttachmentEx ( EntityAI  attachment,
int  slot 
)
private

◆ CanRemoveEntity()

bool CanRemoveEntity ( )
inlineprivate

Returns if entity can be removed from its current location.

References GetCurrentInventoryLocation(), and LocationCanRemoveEntity().

◆ CanRemoveEntityInCargo()

proto native bool CanRemoveEntityInCargo ( notnull EntityAI  e)
private

◆ CanRemoveEntityInCargoEx()

proto native bool CanRemoveEntityInCargoEx ( notnull EntityAI  e,
int  idx,
int  row,
int  col 
)
private

◆ CanSwapEntities()

CanSwapEntities ( notnull EntityAI  item1,
notnull EntityAI  item2 
)
staticprivate

test if ordinary swap can be performed.

Ordinary in the sense that the two items has equal sizes and can be swapped without additional space.

Parameters
[in]item1first item
[in]item2second item
Returns
true if can be swapped

Referenced by CanSwapEntitiesEx().

◆ CanSwapEntitiesEx()

◆ CanUnlockInventoryWithKey()

proto native bool CanUnlockInventoryWithKey ( notnull EntityAI  key)
private

◆ CheckDropRequest()

static proto native bool CheckDropRequest ( notnull Man  requestingPlayer,
notnull InventoryLocation  src,
float  radius 
)
staticprivate

◆ CheckManipulatedObjectsDistances()

static proto native bool CheckManipulatedObjectsDistances ( notnull EntityAI  e0,
notnull EntityAI  e1,
float  radius 
)
staticprivate

◆ CheckMoveToDstRequest()

static proto native bool CheckMoveToDstRequest ( notnull Man  requestingPlayer,
notnull InventoryLocation  src,
notnull InventoryLocation  dst,
float  radius 
)
staticprivate

◆ CheckRequestSrc()

static proto native bool CheckRequestSrc ( notnull Man  requestingPlayer,
notnull InventoryLocation  src,
float  radius 
)
staticprivate

◆ CheckSwapItemsRequest()

static proto native bool CheckSwapItemsRequest ( notnull Man  requestingPlayer,
notnull InventoryLocation  src1,
notnull InventoryLocation  src2,
notnull InventoryLocation  dst1,
notnull InventoryLocation  dst2,
float  radius 
)
staticprivate

◆ CheckTakeItemRequest()

static proto native bool CheckTakeItemRequest ( notnull Man  requestingPlayer,
notnull InventoryLocation  src,
notnull InventoryLocation  dst,
float  radius 
)
staticprivate

◆ ClearInventoryReservation()

static proto native bool ClearInventoryReservation ( EntityAI  item,
InventoryLocation  dst 
)
staticprivate

◆ ClearInventoryReservationEx()

◆ CountInventory()

CountInventory ( )
private

almost identical to EnumerateInventory except it does not return items

Returns
number of items

◆ CreateAttachment()

CreateAttachment ( string  typeName)
private

Create Entity of specified type as attachment of entity.

◆ CreateAttachmentEx()

CreateAttachmentEx ( string  typeName,
int  slotId 
)
private

Create Entity of specified type as attachment of entity.

Parameters
typeNametype to create
slotIdthe slot to be created in

◆ CreateEntityInCargo()

proto native EntityAI CreateEntityInCargo ( string  typeName)
private

Create Entity of specified type in cargo of entity.

◆ CreateEntityInCargoEx()

proto native EntityAI CreateEntityInCargoEx ( string  typeName,
int  idx,
int  row,
int  col,
bool  flip 
)
private

Create Entity of specified type in cargo of entity at coordinates (row, col)

Parameters
typeNametype to create
rowthe row of cargo to be created at
colthe column of cargo to be created at

◆ CreateInInventory()

◆ DropEntity()

◆ DropEntityInBounds()

bool DropEntityInBounds ( InventoryMode  mode,
EntityAI  owner,
notnull EntityAI  item,
vector  halfExtents,
float  angle,
float  cosAngle,
float  sinAngle 
)
inlineprivate

◆ DropEntityWithTransform()

bool DropEntityWithTransform ( InventoryMode  mode,
EntityAI  owner,
notnull EntityAI  item,
vector  transform[4] 
)
inlineprivate

◆ EEDelete()

void EEDelete ( EntityAI  parent)
inlineprivate

References GetInventoryOwner().

◆ EEInit()

◆ EnumerateInventory()

EnumerateInventory ( InventoryTraversalType  tt,
out array< EntityAI items 
)
private

enumerate inventory using traversal type and filling items array

Parameters
[in]ttused traversal type
[out]itemsitems in inventory (in order determined by traversal)
Returns
true if found any, false otherwise

Referenced by AddDamageToItemByFireEx(), InventoryItem::ClearInventory(), ManBase::ClearInventory(), and PrintAll().

◆ ExtendInventoryReservation()

static proto native bool ExtendInventoryReservation ( EntityAI  item,
InventoryLocation  dst,
int  timeout_ms 
)
staticprivate

◆ ExtendInventoryReservationEx()

◆ FindAttachment()

proto native EntityAI FindAttachment ( int  slot)
private

Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)

Referenced by ActionAttachOnSelection::FindSlotIdToAttachOrCombine(), and AnalyticsManagerClient::OnItemAttachedAtPlayer().

◆ FindAttachmentByName()

proto native EntityAI FindAttachmentByName ( string  slotName)
private

Returns attached entity in slot (you can use EntityAI.GetActionComponentName to get slot id)

◆ FindFirstFreeLocationForNewEntity()

proto native bool FindFirstFreeLocationForNewEntity ( string  item_type,
FindInventoryLocationType  flags,
out notnull InventoryLocation  loc 
)
private

FindFirstFreeLocationForNewEntity.

Parameters
[in]item_typeitem type that would be placed in inventory
[out]locthe InventoryLocation the item can be placed to
Returns
true if found any, false otherwise

Referenced by CreateInInventory().

◆ FindFreeLocationFor()

proto native bool FindFreeLocationFor ( notnull EntityAI  item,
FindInventoryLocationType  flags,
out notnull InventoryLocation  loc 
)
private

FindFreeLocationFor.

Parameters
[in]itemitem that would be placed in inventory
[out]locthe InventoryLocation the item can be placed to
Returns
true if found any, false otherwise

Referenced by AddEntityToInventory(), CanAddEntityInto(), CanAddEntityToInventory(), HumanInventory::TakeEntityToInventory(), and TakeEntityToInventory().

◆ FindFreeLocationForEx()

proto native bool FindFreeLocationForEx ( notnull EntityAI  item,
FindInventoryLocationType  flags,
notnull InventoryLocation  exclude,
out notnull InventoryLocation  loc 
)
private

FindFreeLocationForEx.

Parameters
[in]itemitem that would be placed in inventory
[out]locthe InventoryLocation the item can be placed to
Returns
true if found any, false otherwise

◆ FindFreeLocationsFor()

FindFreeLocationsFor ( notnull EntityAI  item,
FindInventoryLocationType  flags,
out notnull array< ref InventoryLocation locs 
)
private

searches inventory for suitable location for @item

Parameters
[in]itemitem that would be placed in inventory
[in]flagsflags affecting selection (
See also
FindInventoryLocation )
Parameters
[out]locsarray of InventoryLocations the item can be placed to
Returns
number of suitable inventory locations

Example:

Entity bino = GetGame().CreateObject("Binoculars", "3312 0 854");
EntityAI bino2;
if (Class.CastTo(bino2, bino))
{
array<ref InventoryLocation> a = new array<ref InventoryLocation>; // 1) allocate memory for array
for (int i = 0; i < 10; ++i)
{
a.Insert(new InventoryLocation); // 2) pre-allocate inventorylocations from script. engine only fills them in, engine does not allocate memory to avoid mixing.
}
int sz = player.FindFreeLocationsFor(bino, FindInventoryLocationType.ANY_CARGO | FindInventoryLocationType.ATTACHMENT, a); // 3) ask engine to fill the locations
if (sz > 0)
{
bino2.GetCurrentInventoryLocation(src); // 5) get current location
InventoryLocation dst = a[0]; // 6) get first (this is only example)
... use src and dst
}
}
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
proto native Object CreateObject(string type, vector pos, bool create_local=false, bool init_ai=false, bool create_physics=true)
Creates object of certain type.
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Building.c:6
Definition Camera.c:2
InventoryLocation.
Definition InventoryLocation.c:29
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition IsBoxCollidingGeometryProxyClasses.c:28
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

◆ FindPlaceholderForSlot()

proto native EntityAI FindPlaceholderForSlot ( int  slot)
private

Returns placeholder entity for slot (naked arms, legs etc)

◆ FlipCargo()

proto native void FlipCargo ( )
private

◆ ForceSwapEntities()

bool ForceSwapEntities ( InventoryMode  mode,
notnull EntityAI  item1,
notnull EntityAI  item2,
notnull InventoryLocation  item2_dst 
)
inlineprivate

◆ GetAnyInventoryReservationCount()

proto native int GetAnyInventoryReservationCount ( )
private

◆ GetAttachmentFromIndex()

GetAttachmentFromIndex ( int  index)
private
Returns
attached entity by attachment index @NOTE: index is not slot! for getting attachment by slot use FindAttachment

Referenced by GetClosestCarWheel(), and ClosableContainer::RecomputeContainers().

◆ GetAttachmentSlotId()

GetAttachmentSlotId ( int  index)
private
Parameters
indexindex of the slot for attachment (
See also
GetAttachmentSlotsCount)
Returns
slot for attachment

Referenced by HasAttachmentSlot().

◆ GetAttachmentSlotsCount()

GetAttachmentSlotsCount ( )
private
Returns
number of slots for attachments

Referenced by HasAttachmentSlot().

◆ GetCargo()

proto native CargoBase GetCargo ( )
private

◆ GetCargoFromIndex()

proto native CargoBase GetCargoFromIndex ( int  index)
private

◆ GetCurrentAttachmentSlotInfo()

bool GetCurrentAttachmentSlotInfo ( out int  slot_id,
out string  slot_name 
)
inlineprivate

Returns true if the item is currently attached and outputs attachment slot id and name.

References GetCurrentInventoryLocation(), InventoryLocation::GetSlot(), InventorySlots::GetSlotName(), InventoryLocation::GetType(), and InventorySlots::INVALID.

◆ GetCurrentInventoryLocation()

GetCurrentInventoryLocation ( out notnull InventoryLocation  loc)
private

returns information about current item location

Parameters
[out]loccurrent InventoryLocation
Returns
true if current location retrieved (and is valid)

Referenced by CanRemoveEntity(), EEInit(), GetCurrentAttachmentSlotInfo(), IsAttachment(), and IsInCargo().

◆ GetFlipCargo()

proto native bool GetFlipCargo ( )
private

◆ GetInventoryCheckContext()

static int GetInventoryCheckContext ( )
inlinestaticprivate

◆ GetInventoryOwner()

◆ GetInventoryReservationCount()

static proto native bool GetInventoryReservationCount ( EntityAI  item,
InventoryLocation  dst 
)
staticprivate

◆ GetScriptLockCount()

proto native int GetScriptLockCount ( )
private

◆ GetSlotId()

GetSlotId ( int  index)
private

attachments

Parameters
indexindex into array of configured slots (
See also
GetSlotIdCount)
Returns
slot where this item belongs

◆ GetSlotIdCount()

GetSlotIdCount ( )
private
Returns
number of slots this item can belong to

◆ GetSlotLock()

proto native bool GetSlotLock ( int  slot)
private

◆ HasAttachment()

HasAttachment ( notnull EntityAI  e)
private

brief Returns True if entity is attached to this

◆ HasAttachmentEx()

HasAttachmentEx ( notnull EntityAI  e,
int  slot 
)
private

brief Returns True if entity is attached to this in slot

◆ HasAttachmentSlot()

HasAttachmentSlot ( int  slotId)
inlineprivate
Returns
true if this entity has attachments slot with id=slotId

References GetAttachmentSlotId(), and GetAttachmentSlotsCount().

◆ HasEntityInCargo()

proto native bool HasEntityInCargo ( notnull EntityAI  e)
private

◆ HasEntityInCargoEx()

proto native bool HasEntityInCargoEx ( notnull EntityAI  e,
int  idx,
int  row,
int  col 
)
private

◆ HasEntityInInventory()

HasEntityInInventory ( notnull EntityAI  item)
private

query inventory if item is somewhere

All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.

Parameters
[in]itemitem to be found in inventory
Returns
true if found, false otherwise

◆ HasInventoryReservation()

static proto native bool HasInventoryReservation ( EntityAI  item,
InventoryLocation  dst 
)
staticprivate

Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY, FindInventoryReservationMode.LEGACY)

Referenced by HandStateEquipped::OnEntry(), ReserveInventory(), and DeferredSwapEntities::ReserveInventory().

◆ HasInventoryReservationCanAdd()

static proto native bool HasInventoryReservationCanAdd ( EntityAI  item,
InventoryLocation  dst 
)
staticprivate

Internally: !HasInventoryReservationEx(item, dst, FindInventoryReservationMode.ITEM, FindInventoryReservationMode.DST)

◆ HasInventoryReservationEx()

static proto native bool HasInventoryReservationEx ( EntityAI  item,
InventoryLocation  dst,
FindInventoryReservationMode  itemMode,
FindInventoryReservationMode  parentMode 
)
staticprivate

itemMode will iterate over item reservations, parentMode will iterate over parent reservations

◆ HasInventorySlot()

HasInventorySlot ( int  slotId)
private
Returns
true if this entity has inventory slot with id=slotId

◆ HasKeys()

proto native bool HasKeys ( )
private

◆ Init()

Init ( )
inlineprivate

script functions

called by engine right after creation of entity

References GetInventoryOwner().

◆ IsAttachment()

bool IsAttachment ( )
inlineprivate

Returns true if this Inventory owner is an attachment of something.

References GetCurrentInventoryLocation(), and InventoryLocation::GetType().

◆ IsCargoInHiearchy()

bool IsCargoInHiearchy ( )
inlineprivate

Returns true if inventory owner or his hiearchy parents are in cargo.

References GetInventoryOwner(), InventoryLocation::GetType(), and InventoryLocation::IsValid().

◆ IsInCargo()

bool IsInCargo ( )
inlineprivate

Returns true if this Inventory owner is in cargo of something.

References GetCurrentInventoryLocation(), and InventoryLocation::GetType().

Referenced by EntityLightSource::CheckIfParentIsInCargo().

◆ IsInventoryLocked()

proto native bool IsInventoryLocked ( )
private

◆ IsInventoryLockedForLockType()

proto native bool IsInventoryLockedForLockType ( int  lockType)
private

◆ IsInventoryUnlocked()

proto native bool IsInventoryUnlocked ( )
private

◆ IsPlaceholderEntity()

proto native bool IsPlaceholderEntity ( notnull Object  e)
private

◆ LocalDestroyEntity()

◆ LocationAddEntity()

LocationAddEntity ( notnull InventoryLocation  inv_loc)
staticprivate

adds item to inventory location

Returns
true if success, false otherwise

Referenced by AddEntityToInventory(), and ReplaceItemWithNewLambdaBase::UndoRemoveOldItemFromLocation().

◆ LocationCanAddEntity()

LocationCanAddEntity ( notnull InventoryLocation  inv_loc)
staticprivate

queries if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...

query the entity at the specific inventory location

Returns
true if can be added, false otherwise
entity at the location, null otherwise

Referenced by LocationCanAddEntityEx(), and TransferInventory().

◆ LocationCanAddEntityEx()

static bool LocationCanAddEntityEx ( notnull InventoryLocation  inv_loc)
inlinestaticprivate

◆ LocationCanMoveEntity()

LocationCanMoveEntity ( notnull InventoryLocation  src,
notnull InventoryLocation  dst 
)
staticprivate

queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthand for CanRemove + CanAdd query

Returns
true if can be moved, false otherwise

Referenced by HandEventBase::CanPerformEvent(), HandEventBase::CanPerformEventEx(), HandGuardBase::GuardCondition(), LocationCanMoveEntitySyncCheck(), WeaponStateBase::OnAbort(), OnAbort(), WeaponStateBase::OnExit(), and ValidateSyncMove().

◆ LocationCanMoveEntitySyncCheck()

static bool LocationCanMoveEntitySyncCheck ( notnull InventoryLocation  src,
notnull InventoryLocation  dst 
)
inlinestaticprivate

◆ LocationCanRemoveEntity()

LocationCanRemoveEntity ( notnull InventoryLocation  inv_loc)
staticprivate

queries if the entity contained in inv_loc.m_item can be removed from ground/attachment/cargo/hands/...

Returns
true if can be added, false otherwise

Referenced by ReplaceItemWithNewLambdaBase::CanExecuteLambda(), CanRemoveEntity(), and ActionDigInStash::OnFinishProgressServer().

◆ LocationCreateEntity()

LocationCreateEntity ( notnull InventoryLocation  inv_loc,
string  type,
int  iSetupFlags,
int  iRotation 
)
staticprivate

creates new item directly at location

Parameters
[in]typeitem type to be placed in inventory
Returns
created entity, null otherwise

Referenced by ReplaceItemWithNewLambdaBase::CreateNewEntity(), SpawnEntity(), InventoryItem::SplitIntoStackMaxToInventoryLocationEx(), InventoryItem::SplitItemToInventoryLocation(), ThrowEntityFromInventory(), and ActionUncoverHeadBase::UncoverHead().

◆ LocationCreateLocalEntity()

LocationCreateLocalEntity ( notnull InventoryLocation  inv_loc,
string  type,
int  iSetupFlags,
int  iRotation 
)
staticprivate

creates new local item directly at location @NOTE: the item is created localy, i.e. it's not registered to network

Parameters
[in]typeitem type to be placed in inventory
Returns
created entity, null otherwise

Referenced by ReplaceItemWithNewLambdaBase::CreateNewEntity().

◆ LocationGetEntity()

static proto native EntityAI LocationGetEntity ( notnull InventoryLocation  inv_loc)
staticprivate

◆ LocationMoveEntity()

LocationMoveEntity ( notnull InventoryLocation  src_loc,
notnull InventoryLocation  dst_loc 
)
staticprivate

removes item from current inventory location and adds it to destination

Returns
true if success, false otherwise

◆ LocationRemoveEntity()

LocationRemoveEntity ( notnull InventoryLocation  inv_loc)
staticprivate

removes item from inventory location

Returns
true if success, false otherwise

Referenced by ReplaceItemWithNewLambdaBase::RemoveOldItemFromLocation().

◆ LocationSwap()

LocationSwap ( notnull InventoryLocation  src1,
notnull InventoryLocation  src2,
notnull InventoryLocation  dst1,
notnull InventoryLocation  dst2 
)
staticprivate

swaps two entities

Returns
true if success, false otherwise

Referenced by HandActionBase::Action(), HandStartAction::OnEntry(), and OnServerInventoryCommandStatic().

◆ LocationSyncMoveEntity()

LocationSyncMoveEntity ( notnull InventoryLocation  src_loc,
notnull InventoryLocation  dst_loc 
)
staticprivate

synchronously removes item from current inventory location and adds it to destination no anims involved

Returns
true if success, false otherwise

Referenced by HandActionBase::Action(), HandleDropMagazine(), WeaponStateBase::OnAbort(), OnAbort(), HandStateBase::OnEntry(), HandStartAction::OnEntry(), WeaponStateBase::OnEntry(), WeaponStateBase::OnExit(), OnServerInventoryCommandStatic(), and TakeToDst().

◆ LocationTestAddEntity()

LocationTestAddEntity ( notnull InventoryLocation  inv_loc,
bool  do_resevation_check,
bool  do_item_check,
bool  do_lock_check,
bool  do_occupancy_test,
bool  do_script_check,
bool  do_script_load_check 
)
staticprivate

test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...

Returns
true if can be added, false otherwise

Referenced by HandGuardBase::GuardCondition().

◆ LockInventory()

proto native void LockInventory ( int  lockType)
private

◆ LockInventoryWithKey()

proto native void LockInventoryWithKey ( notnull EntityAI  key)
private

◆ MakeDstForSwap()

static bool MakeDstForSwap ( notnull InventoryLocation  src1,
notnull InventoryLocation  src2,
out InventoryLocation  dst1,
out InventoryLocation  dst2 
)
inlinestaticprivate

helper function for swap

Referenced by MakeSrcAndDstForSwap().

◆ MakeSrcAndDstForForceSwap()

static bool MakeSrcAndDstForForceSwap ( notnull EntityAI  item1,
notnull EntityAI  item2,
out InventoryLocation  src1,
out InventoryLocation  src2,
out InventoryLocation  dst1,
notnull InventoryLocation  dst2 
)
inlinestaticprivate

helper function for ForceSwap

Referenced by HumanInventory::ForceSwapEntities(), and ForceSwapEntities().

◆ MakeSrcAndDstForSwap()

static bool MakeSrcAndDstForSwap ( notnull EntityAI  item1,
notnull EntityAI  item2,
out InventoryLocation  src1,
out InventoryLocation  src2,
out InventoryLocation  dst1,
out InventoryLocation  dst2 
)
inlinestaticprivate

helper function for swap

References MakeDstForSwap().

Referenced by HandleSwapEntities(), HumanInventory::SwapEntities(), and SwapEntities().

◆ OnAfterStoreLoad()

void OnAfterStoreLoad ( )
private

◆ OnInputUserDataProcess()

bool OnInputUserDataProcess ( ParamsReadContext  ctx)
private

synchronization

◆ OnInventoryFailure()

void OnInventoryFailure ( InventoryCommandType  type,
InventoryValidationReason  reason,
InventoryLocation  src,
InventoryLocation  dst 
)
private

Referenced by DropEntity().

◆ OnInventoryJunctureFailureFromServer()

void OnInventoryJunctureFailureFromServer ( ParamsReadContext  ctx)
private

◆ OnInventoryJunctureFromServer()

bool OnInventoryJunctureFromServer ( ParamsReadContext  ctx)
private

◆ OnInventoryJunctureRepairFromServer()

bool OnInventoryJunctureRepairFromServer ( ParamsReadContext  ctx)
private

◆ OnServerInventoryCommand()

void OnServerInventoryCommand ( ParamsReadContext  ctx)
private

◆ OnServerInventoryCommandStatic()

◆ OnStoreLoad()

bool OnStoreLoad ( ParamsReadContext  ctx,
int  version 
)
inlineprivate

db load hooks

◆ OnStoreSave()

void OnStoreSave ( ParamsWriteContext  ctx)
private

db store hook

◆ PrepareDropEntityPos()

PrepareDropEntityPos ( EntityAI  owner,
notnull EntityAI  item,
out vector  mat[4],
bool  useValuesInMatrix = false,
int  conflictCheckDepth = -1 
)
staticprivate

Finds a transformation for the item to be dropped to If the initial transforation overlaps with another conflicting entity (i.e. car) then the transform will be snapped to the nearest outer edge. If no valid snapping transformation could be found, then the output from 'PlaceOnSurface' is used.

Parameters
useValuesInMatrixIs ignored if transformation overlaps with possible conflicting entity. If no valid transform is found and this is false then the transform at the owner is used for 'PlaceOnSurface'
conflictCheckDepthIf -1 then no conflict depth check is performed, if 0 then it only checks to see if it conflicts but doesn't perform snapping
Returns
true if valid transformation found near owner

Referenced by DropEquipAndDestroyRootLambda::CopyOldPropertiesToNew(), HandleDropMagazine(), ManBase::PredictiveDropEntity(), SetGroundPosByOwner(), and SetGroundPosByTransform().

◆ ReplaceItemWithNew()

◆ ResetFlipCargo()

proto native void ResetFlipCargo ( )
private

◆ ServerHandEvent()

ServerHandEvent ( notnull Man  player,
notnull EntityAI  item,
ParamsWriteContext  ctx 
)
staticprivate

hand event to clients

Returns
true if success, false otherwise

Referenced by InventoryInputUserData::SendServerHandEventViaInventoryCommand().

◆ ServerLocationMoveEntity()

ServerLocationMoveEntity ( notnull EntityAI  item,
ParamsWriteContext  ctx 
)
staticprivate

removes item from current inventory location and adds it to destination + sync via inventory command

Returns
true if success, false otherwise

◆ ServerLocationSwap()

ServerLocationSwap ( notnull InventoryLocation  src1,
notnull InventoryLocation  src2,
notnull InventoryLocation  dst1,
notnull InventoryLocation  dst2,
ParamsWriteContext  ctx 
)
staticprivate

swaps two entities

Returns
true if success, false otherwise

Referenced by InventoryInputUserData::SendServerSwap().

◆ ServerLocationSyncMoveEntity()

ServerLocationSyncMoveEntity ( Man  player,
notnull EntityAI  item,
ParamsWriteContext  ctx 
)
staticprivate

synchronously removes item from current inventory location and adds it to destination + sync via inventory command no anims involved

Returns
true if success, false otherwise

Referenced by InventoryInputUserData::SendServerMove().

◆ SetFlipCargo()

proto native void SetFlipCargo ( bool  flip)
private

◆ SetGroundPosByOwner()

◆ SetGroundPosByOwnerBounds()

static void SetGroundPosByOwnerBounds ( EntityAI  owner,
notnull EntityAI  item,
out InventoryLocation  ground,
vector  halfExtents,
float  angle,
float  cosAngle,
float  sinAngle 
)
inlinestaticprivate

◆ SetGroundPosByTransform()

static bool SetGroundPosByTransform ( EntityAI  owner,
notnull EntityAI  item,
out InventoryLocation  ground,
vector  transform[4] 
)
inlinestaticprivate

◆ SetSlotLock()

proto native bool SetSlotLock ( int  slot,
bool  locked 
)
private

◆ SwapEntities()

bool SwapEntities ( InventoryMode  mode,
notnull EntityAI  item1,
notnull EntityAI  item2 
)
inlineprivate

◆ TakeEntityAsAttachment()

bool TakeEntityAsAttachment ( InventoryMode  mode,
notnull EntityAI  item 
)
inlineprivate

◆ TakeEntityAsAttachmentEx()

bool TakeEntityAsAttachmentEx ( InventoryMode  mode,
notnull EntityAI  item,
int  slot 
)
inlineprivate

◆ TakeEntityAsTargetAttachment()

bool TakeEntityAsTargetAttachment ( InventoryMode  mode,
notnull EntityAI  target,
notnull EntityAI  item 
)
inlineprivate

◆ TakeEntityAsTargetAttachmentEx()

bool TakeEntityAsTargetAttachmentEx ( InventoryMode  mode,
notnull EntityAI  target,
notnull EntityAI  item,
int  slot 
)
inlineprivate

◆ TakeEntityToCargo()

TakeEntityToCargo ( InventoryMode  mode,
notnull EntityAI  item 
)
inlineprivate

moves item to cargo of this intentory

Parameters
[in]modeinventory mode
[in]itemitem to be put in this inventory as cargo

References inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeEntityToInventory().

Referenced by EntityAI::TakeEntityToCargoImpl().

◆ TakeEntityToCargoEx()

TakeEntityToCargoEx ( InventoryMode  mode,
notnull EntityAI  item,
int  idx,
int  row,
int  col 
)
inlineprivate

moves item on specific cargo location

Parameters
[in]modeinventory mode
[in]itemitem to be put in this inventory as cargo

References Error(), GetInventoryOwner(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), InventoryLocation::SetCargo(), and TakeToDst().

◆ TakeEntityToInventory()

TakeEntityToInventory ( InventoryMode  mode,
FindInventoryLocationType  flags,
notnull EntityAI  item 
)
inlineprivate

Put item anywhere into this entity (as attachment or into cargo, recursively)

Parameters
[in]modeinventory mode
[in]flagspreferred location,
See also
FindInventoryLocationType
Parameters
[in]itemitem to be taken in inventory
Returns
true on success

@NOTE: Predictive.* / Local.* functions: a) 'Predictive' means that the operation uses Client-Side Prediction, i.e. the action runs the same code on both, client AND server.

b) 'Local' operation executes from where it is run, i.e. the operation from client is NOT sent to server, and only client performs the inventory operation (TakeEntityTo.*) this behaviour is necessary when inventory operations are ALREADY synchronized by another means, like Actions. For example

See also
ActionTakeItemToHands that performs OnCompleteServer and OnCompleteClient with synchronization set to false in order to avoid duplicate synchronization.

References Error(), FindFreeLocationFor(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeToDst().

Referenced by TakeEntityAsAttachment(), and TakeEntityToCargo().

◆ TakeEntityToTargetCargo()

bool TakeEntityToTargetCargo ( InventoryMode  mode,
notnull EntityAI  target,
notnull EntityAI  item 
)
inlineprivate

Put item into into cargo of another entity.

References inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeEntityToTargetInventory().

◆ TakeEntityToTargetCargoEx()

bool TakeEntityToTargetCargoEx ( InventoryMode  mode,
notnull CargoBase  cargo,
notnull EntityAI  item,
int  row,
int  col 
)
inlineprivate

Put item into into cargo on specific cargo location of another entity.

References Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), InventoryLocation::SetCargoAuto(), and TakeToDst().

◆ TakeEntityToTargetInventory()

bool TakeEntityToTargetInventory ( InventoryMode  mode,
notnull EntityAI  target,
FindInventoryLocationType  flags,
notnull EntityAI  item 
)
inlineprivate

helper that finds location first, then moves the entity into it

References Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeToDst().

Referenced by TakeEntityAsTargetAttachment(), and TakeEntityToTargetCargo().

◆ TakeToDst()

TakeToDst ( InventoryMode  mode,
notnull InventoryLocation  src,
notnull InventoryLocation  dst 
)
inlineprivate

move src to dst

Parameters
[in]modeinventory mode
[in]srcsource location of the item
[in]dstdestination location of the item

References LocationSyncMoveEntity(), and InventoryInputUserData::SendServerMove().

Referenced by DropEntity(), DropEntityInBounds(), DropEntityWithTransform(), TakeEntityAsTargetAttachmentEx(), TakeEntityToCargoEx(), TakeEntityToInventory(), TakeEntityToTargetCargoEx(), and TakeEntityToTargetInventory().

◆ TestAddEntityInCargoEx()

proto native bool TestAddEntityInCargoEx ( notnull EntityAI  e,
int  idx,
int  row,
int  col,
bool  flip,
bool  do_resevation_check,
bool  do_item_check,
bool  do_lock_check,
bool  do_occupancy_test,
bool  do_script_check,
bool  do_script_load_check 
)
private

◆ TestAddEntityInCargoExLoc()

proto native bool TestAddEntityInCargoExLoc ( notnull InventoryLocation  loc,
bool  do_resevation_check,
bool  do_item_check,
bool  do_lock_check,
bool  do_occupancy_test,
bool  do_script_check,
bool  do_script_load_check 
)
private

◆ TestDropEntityPos()

static proto native bool TestDropEntityPos ( EntityAI  owner,
notnull EntityAI  item,
out vector  mat[4],
bool  useValuesInMatrix = false,
int  conflictCheckDepth = -1 
)
staticprivate

◆ UnlockInventory()

proto native void UnlockInventory ( int  lockType)
private

◆ UnlockInventoryWithKey()

proto native void UnlockInventoryWithKey ( notnull EntityAI  key)
private

Field Documentation

◆ c_InventoryReservationTimeoutMS

◆ c_InventoryReservationTimeoutShortMS

◆ c_MaxItemDistanceRadius

◆ m_inventory_check_context

protected int m_inventory_check_context = InventoryCheckContext.DEFAULT
staticprivate

The documentation for this class was generated from the following file: