DayZ 1.24
Loading...
Searching...
No Matches
HandEventRemove Class Reference
Collaboration diagram for HandEventRemove:
[legend]

Private Member Functions

void HandEventDrop (Man p=null, InventoryLocation src=null)
 
override void ReadFromContext (ParamsReadContext ctx)
 
override void WriteToContext (ParamsWriteContext ctx)
 
override bool CheckRequestEx (InventoryValidation validation)
 
override bool CanPerformEventEx (InventoryValidation validation)
 
void HandEventThrow (Man p=null, InventoryLocation src=null)
 
override void ReadFromContext (ParamsReadContext ctx)
 
override void WriteToContext (ParamsWriteContext ctx)
 
void SetForce (vector force)
 
vector GetForce ()
 

Private Attributes

bool m_CanPerformDrop
 
vector m_Force
 

Detailed Description

Definition at line 363 of file Hand_Events.c.

Member Function Documentation

◆ CanPerformEventEx()

override bool HandEventRemove::CanPerformEventEx ( InventoryValidation validation)
inlineprivate

On multiplayer client, if this is the initial call then we are waiting for the server to setup this event still

Singleplayer or server was initial caller

Definition at line 404 of file Hand_Events.c.

405 {
406 if (!m_CanPerformDrop)
407 return false;
408
410 if (!validation.m_IsJuncture && !validation.m_IsRemote && !GetDst() && (GetGame().IsMultiplayer() && GetGame().IsClient()))
411 return true;
412
414 if (!validation.m_IsRemote && !GetDst())
415 {
416 m_Dst = new InventoryLocation();
418
419 if (!m_CanPerformDrop)
420 {
421 validation.m_Reason = InventoryValidationReason.DROP_PREVENTED;
422 return false;
423 }
424 }
425
426 return super.CanPerformEventEx(validation);
427 }
InventoryValidationReason
Definition Inventory.c:37
DayZPlayer m_Player
Definition Hand_Events.c:42
EntityAI GetSrcEntity()
Definition Hand_Events.c:81
InventoryLocation GetDst()
Definition Hand_Events.c:88
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool SetGroundPosByOwner(EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
Definition Inventory.c:1212
InventoryLocation.
proto native CGame GetGame()

References GetDst(), GetGame(), GetSrcEntity(), m_Player, and GameInventory::SetGroundPosByOwner().

◆ CheckRequestEx()

override bool HandEventRemove::CheckRequestEx ( InventoryValidation validation)
inlineprivate

Check to see if this is the initial call from the server (but the event originated from a client)

Definition at line 389 of file Hand_Events.c.

390 {
392 if (!validation.m_IsJuncture && IsAuthoritative())
394
395 if (!m_CanPerformDrop)
396 {
397 validation.m_Reason = InventoryValidationReason.DROP_PREVENTED;
398 return false;
399 }
400
401 return super.CheckRequestEx(validation);
402 }
bool IsAuthoritative()
Definition Hand_Events.c:55

References GetSrcEntity(), IsAuthoritative(), m_Player, and GameInventory::SetGroundPosByOwner().

◆ GetForce()

vector HandEventRemove::GetForce ( )
inlineprivate

Definition at line 480 of file Hand_Events.c.

480{ return m_Force; }

References m_Force.

◆ HandEventDrop()

void HandEventRemove::HandEventDrop ( Man p = null,
InventoryLocation src = null )
inlineprivate

Definition at line 365 of file Hand_Events.c.

366 {
367 m_EventID = HandEventID.DROP;
368 m_CanPerformDrop = true;
369 }
m_EventID
HandEventID
events
Definition Hand_Events.c:7

References m_EventID.

◆ HandEventThrow()

void HandEventRemove::HandEventThrow ( Man p = null,
InventoryLocation src = null )
inlineprivate

Definition at line 434 of file Hand_Events.c.

435 {
436 m_EventID = HandEventID.THROW;
437 if (src)
438 {
439 vector mat[4];
441 if (entity)
442 {
443 m_Dst = new InventoryLocation;
444 entity.GetTransform(mat);
445 m_Dst.SetGround(entity, mat);
446 }
447 else
448 Error("[hndfsm] HandEventThrow src entity null!");
449 }
450 }
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), GetSrcEntity(), and m_EventID.

◆ ReadFromContext() [1/2]

override void HandEventRemove::ReadFromContext ( ParamsReadContext ctx)
inlineprivate

Definition at line 371 of file Hand_Events.c.

372 {
373 super.ReadFromContext(ctx);
374
375 ctx.Read(m_CanPerformDrop);
377 if (!m_Dst)
378 m_Dst = new InventoryLocation();
379 }
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)

References OptionalLocationReadFromContext().

◆ ReadFromContext() [2/2]

override void HandEventRemove::ReadFromContext ( ParamsReadContext ctx)
inlineprivate

Definition at line 452 of file Hand_Events.c.

453 {
454 super.ReadFromContext(ctx);
455
456 m_Dst = new InventoryLocation;
457 m_Dst.ReadFromContext(ctx);
458
459 float x, y, z;
460 ctx.Read(x);
461 ctx.Read(y);
462 ctx.Read(z);
463 m_Force[0] = x;
464 m_Force[1] = y;
465 m_Force[2] = z;
466 }
Icon x
Icon y
bool ReadFromContext(ParamsReadContext ctx)

References InventoryLocation::ReadFromContext(), x, and y.

◆ SetForce()

void HandEventRemove::SetForce ( vector force)
inlineprivate

Definition at line 479 of file Hand_Events.c.

479{ m_Force = force; }

◆ WriteToContext() [1/2]

override void HandEventRemove::WriteToContext ( ParamsWriteContext ctx)
inlineprivate

Definition at line 381 of file Hand_Events.c.

382 {
383 super.WriteToContext(ctx);
384
385 ctx.Write(m_CanPerformDrop);
387 }
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)

References OptionalLocationWriteToContext().

◆ WriteToContext() [2/2]

override void HandEventRemove::WriteToContext ( ParamsWriteContext ctx)
inlineprivate

Definition at line 468 of file Hand_Events.c.

469 {
470 super.WriteToContext(ctx);
471
472 m_Dst.WriteToContext(ctx);
473
474 ctx.Write(m_Force[0]);
475 ctx.Write(m_Force[1]);
476 ctx.Write(m_Force[2]);
477 }

Member Data Documentation

◆ m_CanPerformDrop

bool HandEventRemove::m_CanPerformDrop
private

Definition at line 429 of file Hand_Events.c.

◆ m_Force

vector HandEventRemove::m_Force
private

Definition at line 482 of file Hand_Events.c.

Referenced by GetForce().


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