DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ReadFromContext()

bool ActionBase::ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprotected

create target object from proxyBoneIdx synced from client

См. определение в файле ActionBase.c строка 482

483 {
484 if ( !action_recive_data )
485 {
486 action_recive_data = new ActionReciveData;
487 }
488 Object actionTargetObject = null;
489 Object actionTargetParent = null;
490 int componentIndex = -1;
491 int proxyBoneIdx = -1;
492 vector cursorHitPos = vector.Zero;
493 ItemBase mainItem = null;
494
495 ref ActionTarget target;
496
497 if ( UseMainItem() )
498 {
499 if ( !ctx.Read(mainItem) )
500 return false;
501 }
502
503 if ( HasTarget() && !IsUsingProxies() )
504 {
505 if ( !ctx.Read(actionTargetObject) )
506 return false;
507
508 if ( !ctx.Read(actionTargetParent))
509 return false;
510
511 if ( !ctx.Read(componentIndex) )
512 return false;
513
514 if ( !ctx.Read(cursorHitPos) )
515 return false;
516
517 target = new ActionTarget(actionTargetObject, actionTargetParent, componentIndex, cursorHitPos, 0);
518
519 action_recive_data.m_Target = target;
520 }
521 else if( HasTarget() && IsUsingProxies() )
522 {
523 if ( !ctx.Read(proxyBoneIdx) )
524 return false;
525
526 if ( !ctx.Read(actionTargetParent))
527 return false;
528
529 if ( !ctx.Read(componentIndex) )
530 return false;
531
532 if ( !ctx.Read(cursorHitPos) )
533 return false;
534
536 if ( proxyBoneIdx > -1 )
537 {
538 Entity entParent = Entity.Cast(actionTargetParent);
539
540 if (entParent)
541 {
542 actionTargetObject = entParent.GetBoneObject(proxyBoneIdx);
543 }
544 }
545 else
546 {
547 return false;
548 }
549
550 target = new ActionTarget(actionTargetObject, actionTargetParent, componentIndex, cursorHitPos, 0);
551
552 action_recive_data.m_Target = target;
553 }
554
555 action_recive_data.m_MainItem = mainItem;
556 return true;
557 }
class ActionTargets ActionTarget
class GP5GasMask extends MaskBase ItemBase
bool HasTarget()
Определения ActionBase.c:244
bool UseMainItem()
Определения ActionBase.c:379
bool IsUsingProxies()
not using plane object - it's using multiple proxies
Определения ActionBase.c:268
proto bool Read(void value_in)
class LOD Object

Перекрестные ссылки ActionTarget, HasTarget(), IsUsingProxies(), Serializer::Read(), UseMainItem() и vector::Zero.

Используется в ActionManagerServer::OnInputUserDataProcess().