DayZ 1.29
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 строка 494

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

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

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