Dayz Explorer 1.29.162510
Loading...
Searching...
No Matches
humaninventory.c
Go to the documentation of this file.
1
10{
11 int m_syncClearUserReservationindex = -1;
12 //int m_UserReservationToClear = -1;
16 proto native EntityAI GetEntityInHands();
17
21 proto native bool CanAddEntityInHands(EntityAI e);
22
30 proto native bool TestAddEntityInHands(EntityAI e, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check);
31
35 proto native bool CanRemoveEntityInHands();
36
37 proto native bool CanOpenInventory();
38
44 proto native EntityAI CreateInHands(string typeName);
45
46 proto native int GetUserReservedLocationCount();
47 proto native int FindUserReservedLocationIndex(notnull EntityAI e);
48 proto native int FindCollidingUserReservedLocationIndex(notnull EntityAI e, notnull InventoryLocation dst);
49 proto native void GetUserReservedLocation(int index, out notnull InventoryLocation dst);
50 proto native int FindFirstUserReservedLocationIndexForContainer(notnull EntityAI e);
51
52 proto native void SetUserReservedLocation(notnull EntityAI eai, notnull InventoryLocation dst);
53 proto native void ClearUserReservedLocation(notnull EntityAI eai);
54 proto native bool ClearUserReservedLocationAtIndex(int index);
55 proto native void ClearUserReservedLocationForContainer(notnull EntityAI eai);
56 proto native bool GetDebugFlag();
57
65 override EntityAI CreateInInventory(string type)
66 {
67 EntityAI newEntity = super.CreateInInventory(type);
68 if (newEntity == null)
69 newEntity = CreateInHands(type);
70 return newEntity;
71 }
72
73 void ClearUserReservedLocationSynced(notnull EntityAI eai)
74 {
75 if (g_Game.IsClient())
76 m_syncClearUserReservationindex = FindUserReservedLocationIndex(eai);
77 else if (!g_Game.IsMultiplayer())
78 {
79 ClearUserReservedLocation(eai);
80 eai.GetOnReleaseLock().Invoke(eai);
81 }
82
83 }
84
85 void ClearUserReservedLocationAtIndexSynced(int index)
86 {
87 if (g_Game.IsClient())
88 m_syncClearUserReservationindex = index;
89 else if (!g_Game.IsMultiplayer())
90 {
91 ClearUserReservedLocationAtIndex(index);
92
94
95 GetUserReservedLocation(index,il);
96 EntityAI item = il.GetItem();
97 item.GetOnReleaseLock().Invoke(item);
98 }
99
100 }
101
102 Man GetManOwner()
103 {
104 return Man.Cast(GetInventoryOwner());
105 }
106
107 bool HasEntityInHands(EntityAI e)
108 {
109 return e == GetEntityInHands();
110 }
111
112 bool ProcessHandEvent(HandEventBase e);
113
114 void OnHandsStateChanged(HandStateBase src, HandStateBase dst);
115 void OnHandsExitedStableState(HandStateBase src, HandStateBase dst);
116 void OnHandsEnteredStableState(HandStateBase src, HandStateBase dst);
117
118 void OnEntityInHandsCreated(InventoryLocation src)
119 {
121 cpy.Copy(src);
122 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] OnEntityInHandsCreated src=" + InventoryLocation.DumpToStringNullSafe(cpy));
123 ProcessHandEvent(new HandEventCreated(GetManOwner(), src));
124 }
125
126 void OnEntityInHandsDestroyed(InventoryLocation src)
127 {
129 cpy.Copy(src);
130 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] OnEntityInHandsDestroyed src=" + InventoryLocation.DumpToStringNullSafe(cpy));
131 ProcessHandEvent(new HandEventDestroyed(GetManOwner(), cpy));
132 }
133
134 bool HandEvent(InventoryMode mode, HandEventBase e)
135 {
136 return true;
137 }
138
139 override bool DropEntity(InventoryMode mode, EntityAI owner, notnull EntityAI item)
140 {
142 if (item)
143 {
144 GameInventory itemInventory = item.GetInventory();
145 if (itemInventory && itemInventory.GetCurrentInventoryLocation(src))
146 {
147 switch (src.GetType())
148 {
149 case InventoryLocationType.HANDS:
150 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::DropEntity(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item);
151 HandEvent(mode, new HandEventDrop(GetManOwner(), src));
152 return true;
153
154 default:
155 return super.DropEntity(mode, owner, item);
156 }
157 }
158 }
159
160 Error("No inventory location");
161 return false;
162 }
163
164 bool ThrowEntity(EntityAI item, vector dir, float force)
165 {
166 if (g_Game.IsServer() && g_Game.IsMultiplayer())
167 return false;
168
169 DayZPlayer player = DayZPlayer.Cast(item.GetHierarchyRootPlayer());
170 InventoryMode invMode = InventoryMode.PREDICTIVE;
171
172 if (player.NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), null))
173 invMode = InventoryMode.JUNCTURE;
174
176 if (item)
177 {
178 GameInventory itemInventory = item.GetInventory();
179 if (itemInventory && itemInventory.GetCurrentInventoryLocation(src))
180 {
181 switch (src.GetType())
182 {
183 case InventoryLocationType.HANDS:
184 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ThrowEntity item=" + item);
185 HandEventThrow throwEvent = new HandEventThrow(GetManOwner(), src);
186 throwEvent.SetForce(dir * force);
187 HandEvent(invMode, throwEvent);
188 return true;
189
190 default:
191 DropEntity(invMode, player, item);
192 return true;
193 }
194 }
195 }
196 Error("No inventory location");
197 return false;
198 }
199
200 bool RedirectToHandEvent(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
201 {
202 if (src.GetType() == InventoryLocationType.HANDS)
203 {
204 Man man_src = Man.Cast(src.GetParent());
205 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - source location == HANDS, player has to handle this");
206
207 EntityAI item = src.GetItem();
208
209 int r_index = FindUserReservedLocationIndex(item);
210
211 if (r_index >= 0)
212 {
214 GetUserReservedLocation(r_index,r_il);
215
216 ClearUserReservedLocationAtIndex(r_index);
217 int r_type = r_il.GetType();
218 if (r_type == InventoryLocationType.CARGO || r_type == InventoryLocationType.PROXYCARGO)
219 {
220 r_il.GetParent().GetOnReleaseLock().Invoke(item);
221 }
222 else if (r_type == InventoryLocationType.ATTACHMENT)
223 {
224 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(item, r_il.GetSlot());
225 }
226 }
227
228 man_src.GetHumanInventory().HandEvent(mode, new HandEventMoveTo(man_src, src, dst));
229 return true;
230 }
231
232 if (dst.GetType() == InventoryLocationType.HANDS)
233 {
234 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - dst location == HANDS, player has to handle this");
235
236 Man man_dst = Man.Cast(dst.GetParent());
237 man_dst.GetHumanInventory().HandEvent(mode, new HandEventTake(man_dst, src));
238 return true;
239 }
240 return false;
241 }
242
243 override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
244 {
245 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] Take2Dst(" + typename.EnumToString(InventoryMode, mode) + ") src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
246
247 if (GetManOwner().IsAlive() && RedirectToHandEvent(mode, src, dst))
248 return true;
249
250 return super.TakeToDst(mode, src, dst);
251 }
252
253 override bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
254 {
256 if (item.GetInventory().GetCurrentInventoryLocation(src))
257 {
259 if (FindFreeLocationFor(item, flags, dst))
260 {
261 if (RedirectToHandEvent(mode, src, dst))
262 return true;
263
264 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Inv(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item);
265 return super.TakeEntityToInventory(mode, flags, item);
266 }
267 else
268 return false; // no room
269 }
270 Error("HumanInventory::TakeEntityToInventory: No inventory location");
271 return false;
272 }
273
277 override bool TakeEntityToCargoEx(InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
278 {
280 GameInventory itemInventory = item.GetInventory();
281 if (itemInventory.GetCurrentInventoryLocation(src))
282 {
283 switch (src.GetType())
284 {
285 case InventoryLocationType.HANDS:
286 EntityAI inventoryOwner = GetInventoryOwner();
287 if (inventoryOwner.IsAlive())
288 {
289 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Cgo(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item + " row=" + row + " col=" + col);
291 dst.SetCargo(inventoryOwner, item, idx, row, col, itemInventory.GetFlipCargo());
292
293 HandEvent(mode, new HandEventMoveTo(GetManOwner(), src, dst));
294 return true;
295 }
296
297 return super.TakeEntityToCargoEx(mode, item, idx, row, col);
298
299 default:
300 return super.TakeEntityToCargoEx(mode, item, idx, row, col);
301 }
302 }
303
304 Error("HumanInventory::TakeEntityToCargoEx: No inventory location");
305 return false;
306 }
307
308 override bool TakeEntityAsAttachmentEx(InventoryMode mode, notnull EntityAI item, int slot)
309 {
311 if (item.GetInventory().GetCurrentInventoryLocation(src))
312 {
313 switch (src.GetType())
314 {
315 case InventoryLocationType.HANDS:
316 EntityAI inventoryOwner = GetInventoryOwner();
317 if (inventoryOwner.IsAlive())
318 {
319 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Att(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item + " slot=" + slot);
321 dst.SetAttachment(inventoryOwner, item, slot);
322
323 HandEvent(mode, new HandEventMoveTo(GetManOwner(), src, dst));
324 return true;
325 }
326
327 return super.TakeEntityAsAttachmentEx(mode, item, slot);
328
329 default:
330 return super.TakeEntityAsAttachmentEx(mode, item, slot);
331 }
332 }
333
334 Error("HumanInventory::TakeEntityAsAttachmentEx: No inventory location");
335 return false;
336 }
337
338 override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
339 {
340 InventoryLocation src1, src2, dst1, dst2;
341 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
342 {
343 bool handled = false;
344 switch (src1.GetType())
345 {
346 case InventoryLocationType.HANDS:
348 InventoryLocation fswap_dst2 = new InventoryLocation;
349 if ( SwappingToPreviousLocation(item1, item2, fswap_dst2) )
350 {
351 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventForceSwap(" + typename.EnumToString(InventoryMode, mode) + ") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2));
352 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
353 }
354 else
355 {
356 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + "src2=" + InventoryLocation.DumpToStringNullSafe(src2));
357 HandEvent(mode, new HandEventSwap(GetManOwner(), src1, src2, dst1, dst2));
358 }
359 handled = true;
360 break;
361 }
362
363 switch (src2.GetType())
364 {
365 case InventoryLocationType.HANDS:
366 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap2(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
367 HandEvent(mode, new HandEventSwap(GetManOwner(), src2, src1, dst2, dst1));
368 handled = true;
369 break;
370 }
371
372 if (!handled)
373 return super.SwapEntities(mode, item1, item2);
374
375 return true;
376 }
377
378 Error("HumanInventory::SwapEntities: cannot create src1, src2, dst1, dst2");
379 return false;
380 }
381
382 override bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
383 {
384 InventoryLocation src1, src2, dst1;
385 if (GameInventory.MakeSrcAndDstForForceSwap(item1, item2, src1, src2, dst1, item2_dst))
386 {
387 GameInventory manOwnerInventory = GetManOwner().GetInventory();
388
389 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap(" + typename.EnumToString(InventoryMode, mode) + ") dst1=" + InventoryLocation.DumpToStringNullSafe(dst1)+ " dst2=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
390 bool handled = false;
391 switch (src1.GetType())
392 {
393 case InventoryLocationType.HANDS:
394 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap-HND@1(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2) + " dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) + " item2_dst=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
395 HandEventBase e = new HandEventForceSwap(GetManOwner(), src1, src2, dst1, item2_dst);
396 e.ReserveInventory();
397 HandEvent(mode, e);
398 handled = true;
399 break;
400
401 }
402
403 switch (src2.GetType())
404 {
405 case InventoryLocationType.HANDS:
407 InventoryLocation fswap_dst2 = new InventoryLocation;
408 if ( SwappingToPreviousLocation(item2, item1, fswap_dst2))
409 {
410 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap-PREV(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2) + " dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) + " fswap_dst2=" + InventoryLocation.DumpToStringNullSafe(fswap_dst2));
411 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
412 }
413 else
414 {
415 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap-HND@2(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2) + " dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) + " item2_dst=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
416 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, item2_dst));
417 }
418
419 handled = true;
420 break;
421 }
422
423 bool returnValue = true;
424
425 if (!handled)
426 returnValue = super.ForceSwapEntities(mode, item1, item2, item2_dst);
427
428 return returnValue;
429 }
430
431 Error("HumanInventory::ForceSwapEntities: No inventory location");
432 return false;
433 }
434
435 override bool LocalDestroyEntity(notnull EntityAI item)
436 {
438 if (item.GetInventory().GetCurrentInventoryLocation(src))
439 {
440 switch (src.GetType())
441 {
442 case InventoryLocationType.HANDS:
443 if (GetInventoryOwner().IsAlive())
444 {
445 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::LocalDestroy inv item=" + item);
446 HandEvent(InventoryMode.LOCAL, new HandEventDestroy(GetManOwner(), src));
447 return true;
448 }
449
450 return super.LocalDestroyEntity(item);
451
452 default:
453 return super.LocalDestroyEntity(item);
454 }
455 }
456
457 Error("LocalDestroyEntity: No inventory location");
458 return false;
459 }
460
461 override bool ReplaceItemWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
462 {
463 EntityAI itemInHands = GetEntityInHands();
464 if (itemInHands == lambda.m_OldItem)
465 return ReplaceItemInHandsWithNew(mode, lambda);
466
467 return super.ReplaceItemWithNew(mode, lambda);
468 }
469
470 bool ReplaceItemElsewhereWithNewInHands(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
471 {
472 HandEventBase heb = new HandEventDestroyElsewhereAndReplaceWithNewInHands(GetManOwner(), null, lambda);
474 }
475
477 {
478 if (GetEntityInHands())
479 {
480 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl Item in hands, event=" + e.DumpToString());
481 return false;
482 }
483
484 InventoryLocation dst = e.GetDst();
485 if (dst)
486 {
487 switch (dst.GetType())
488 {
489 case InventoryLocationType.HANDS:
490 if (GetInventoryOwner().IsAlive())
491 {
492 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl event=" + e);
493 HandEvent(mode, e);
494 return true;
495 }
496
497 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl DEAD_owner=" + GetInventoryOwner().GetName() +"="+ GetInventoryOwner());
498 Error("HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl TODO"); // replace-with-new in corpse's hands, not implemented
499 return false;
500
501 default:
502 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl src has to be hands");
503 return false;
504 }
505 }
506
507 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl no dst in event, event=" + e.DumpToString());
508 return false;
509 }
510
512 {
513 EntityAI itemInHands = GetEntityInHands();
515 if (itemInHands && itemInHands.GetInventory().GetCurrentInventoryLocation(src))
516 {
517 switch (src.GetType())
518 {
519 case InventoryLocationType.HANDS:
520 if ((mode != InventoryMode.SERVER) && GetInventoryOwner().IsAlive())
521 {
522 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl event=" + e);
523 HandEvent(mode, e);
524 return true;
525 }
526
527 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl DEAD_owner=" + GetInventoryOwner().GetName() +"="+ GetInventoryOwner());
528 HandEvent(mode, e);
529 return true;
530
531 default:
532 Error("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl src has to be hands");
533 return false;
534 }
535 }
536
537 Error("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl No item in hands, event=" + e.DumpToString());
538 return false;
539 }
540
542 {
543 HandEventBase heb = new HandEventDestroyAndReplaceWithNew(GetManOwner(), null, lambda);
544 return ReplaceItemInHandsWithNewImpl(mode, heb);
545 }
546
548 {
549 HandEventBase heb = new HandEventDestroyAndReplaceWithNewElsewhere(GetManOwner(), null, lambda);
550 return ReplaceItemInHandsWithNewImpl(mode, heb);
551 }
552
554 {
555 bool SwapToPrevious = true;
558 dst = new InventoryLocation();
559 GameInventory item1Inventory = item1.GetInventory();
560 if (item1Inventory.GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
561 {
562 if (item1.m_OldLocation && item1.m_OldLocation.IsValid() && !item1.m_OldLocation.CollidesWith(src2) && item1.m_OldLocation.GetParent() && item1.m_OldLocation.GetParent().GetHierarchyRootPlayer())
563 {
564 dst.Copy(item1.m_OldLocation);
565
566 if (src2.GetType() == InventoryLocationType.ATTACHMENT) //item2 is currently attached somewhere
567 {
568 int count = item1Inventory.GetSlotIdCount();
569 for (int i = 0; i < count; ++i)
570 {
571 int slotID = item1Inventory.GetSlotId(i);
572 if (src2.GetSlot() == slotID) //can be attached into the same slot. And will be.
573 return false;
574 }
575 }
576
577 if (!item1.m_OldLocation.GetParent().GetInventory().LocationCanAddEntity(item1.m_OldLocation))
578 SwapToPrevious = false;
579
580 if (CanSwapEntitiesEx(item1,item2))
581 SwapToPrevious = false;
582
583 if (SwapToPrevious)
584 return true;
585 }
586 }
587
588 return false;
589 }
590
592
593 void Update(float delta_time)
594 {
596 if ( m_syncClearUserReservationindex != -1 && ScriptInputUserData.CanStoreInputUserData())
597 {
599 ctx.Write(INPUT_UDT_INVENTORY);
600 ctx.Write(InventoryCommandType.USER_RESERVATION_CANCEL);
601 ctx.Write(m_syncClearUserReservationindex);
602 ctx.Send();
603
605
606 GetUserReservedLocation(m_syncClearUserReservationindex,il);
607 ClearUserReservedLocationAtIndex(m_syncClearUserReservationindex);
608 EntityAI item = il.GetItem();
609 item.GetOnReleaseLock().Invoke(item);
610 m_syncClearUserReservationindex = -1;
611 }
612 }
613
615 {
616 validation.m_Result = InventoryValidationResult.SUCCESS;
617
618 int index = -1;
619 if (!ctx.Read(index))
620 {
622 return true;
623 }
624
625 ClearUserReservedLocationAtIndex(index);
626 //m_UserReservationToClear = index;
627
628 return true;
629 }
630
632 {
633 return true;
634 }
635
636
637 bool PostDeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
638 {
639 return true;
640 }
641
642 bool OnInventoryCheck(int userDataType, ParamsReadContext ctx)
643 {
644 return false;
645 }
646}
InventoryCommandType
Definition inventory.c:3
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition inventory.c:22
InventoryValidationResult
Definition inventory.c:30
const int INPUT_UDT_INVENTORY
Definition _constants.c:9
script counterpart to engine's class Inventory
Definition inventory.c:81
proto native bool GetFlipCargo()
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
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
Definition inventory.c:1211
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition inventory.c:630
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
Definition inventory.c:1223
proto native EntityAI GetInventoryOwner()
Engine native functions.
proto native int GetSlotId(int index)
attachments
proto native int GetSlotIdCount()
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
Abstracted event, not to be used, only inherited.
represent hand state base
inventory for plain man/human
bool OnInventoryCheck(int userDataType, ParamsReadContext ctx)
bool ReplaceItemInHandsWithNewElsewhere(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
bool PostDeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
void HandleInventoryManipulation()
bool ValidateUserReservationCancel(inout Serializer ctx, InventoryValidation validation)
bool ReplaceItemInHandsWithNewImpl(InventoryMode mode, HandEventBase e)
bool ReplaceItemInHandsWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
bool SwappingToPreviousLocation(EntityAI item1, EntityAI item2, out InventoryLocation dst)
bool ReplaceItemInElsewhereWithNewinHandsImpl(InventoryMode mode, HandEventBase e)
void Update(float delta_time)
bool PostDeferredEventTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
InventoryLocation.
base class for transformation operations (creating one item from another)
Serialization general interface. Serializer API works with:
Definition serializer.c:56
DayZGame g_Game
Definition dayzgame.c:3942
Serializer ParamsReadContext
Definition gameplay.c:15
void Error(string err)
Messagebox with error message.
Definition endebug.c:90
proto string GetName()
Suite class name getter. Strictly for UI porposes!
Definition syncedvalue.c:50
void hndDebugPrint(string s)
Definition handfsm.c:1
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location