DayZ 1.24
Loading...
Searching...
No Matches
DropEquipAndDestroyRootLambda Class Reference

this one is a bit special: it drops all items and destroys the ex-root of the hierarchy More...

Inheritance diagram for DropEquipAndDestroyRootLambda:
[legend]
Collaboration diagram for DropEquipAndDestroyRootLambda:
[legend]

Private Member Functions

void DropEquipAndDestroyRootLambda (EntityAI old_item, string new_item_type, PlayerBase player)
 
override void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
 
- Private Member Functions inherited from ReplaceItemWithNewLambdaBase
bool WantCreateNewEntity ()
 
bool CanExecuteLambda ()
 
bool PrepareLocations ()
 Step A. - prepare inventory locations.
 
void RemoveOldItemFromLocation ()
 Step B. - free location for new item @NOTE this operation does not delete the object, only removes it from inventory location.
 
void UndoRemoveOldItemFromLocation ()
 
void RemoveNetworkObjectInfo ()
 Step C. - remove network part of the object @NOTE this operation does not delete the object, only removes its network part (and deletes it on client)
 
void UndoRemoveNetworkObjectInfo ()
 
EntityAI CreateNewEntity ()
 Step D. - create new entity (LOCAL) with specified type.
 
void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
 Step E. copy properties from old object to the created one.
 
void DeleteOldEntity ()
 Step F. - deletes physically old item.
 
void CreateNetworkObjectInfo (EntityAI new_item)
 Step G. - create NetworkObjectInfo for new item.
 
void OnSuccess (EntityAI new_item)
 Step H. - notification on finish.
 
void OnAbort ()
 Step Out - notification on abort.
 
void Execute (HumanInventoryWithFSM fsm_to_notify=null)
 
string DumpToString ()
 

Private Attributes

PlayerBase m_Player
 
- Private Attributes inherited from ReplaceItemWithNewLambdaBase
ref InventoryLocation m_OldLocation
 
ref InventoryLocation m_NewLocation
 
bool m_RemoveFromLocationPassed = false
 

Detailed Description

this one is a bit special: it drops all items and destroys the ex-root of the hierarchy

Definition at line 105 of file MiscGameplayFunctions.c.

Constructor & Destructor Documentation

◆ DropEquipAndDestroyRootLambda()

void DropEquipAndDestroyRootLambda::DropEquipAndDestroyRootLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player )
inlineprivate

Definition at line 109 of file MiscGameplayFunctions.c.

References m_Player.

Member Function Documentation

◆ CopyOldPropertiesToNew()

override void DropEquipAndDestroyRootLambda::CopyOldPropertiesToNew ( notnull EntityAI old_item,
EntityAI new_item )
inlineprivate

We don't care if a valid transform couldn't be found, we just want to preferably use it instead of placing on the old item

Definition at line 114 of file MiscGameplayFunctions.c.

115 {
116 super.CopyOldPropertiesToNew(old_item, new_item);
117
118 InventoryLocation understash_src = m_NewLocation; // m_NewLocation is a backup of original old_item's src before the operation started
119
121 old_item.GetInventory().EnumerateInventory(InventoryTraversalType.LEVELORDER, children);
122 int count = children.Count();
123 for (int i = 0; i < count; i++)
124 {
125 EntityAI child = children.Get(i);
126 if (child)
127 {
129 child.GetInventory().GetCurrentInventoryLocation(child_src);
130
132 //@TODO: modify _dst with place on gnd?
133
134 vector m4[4];
136
139
140 child_dst.SetGround(child, m4);
141
142 m_Player.LocalTakeToDst(child_src, child_dst);
143
144 GetGame().RemoteObjectTreeCreate(child); // this forces server to send CreateVehicle Message to client. This is needed for preserving the appearance of network operations on client (so that DeleteObject(old) arrives before CreateVehicle(new)). @NOTE: this does not delete the object on server, only it's network representation.
145 }
146 }
147 }
script counterpart to engine's class Inventory
Definition Inventory.c:79
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 anoth...
InventoryLocation.
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Definition gameplay.c:6
proto native CGame GetGame()
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
Definition EnMath3D.c:233

References GetGame(), ReplaceItemWithNewLambdaBase::m_NewLocation, m_Player, Math3D::MatrixIdentity4(), and GameInventory::PrepareDropEntityPos().

Member Data Documentation

◆ m_Player

PlayerBase DropEquipAndDestroyRootLambda::m_Player
private

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