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

◆ ReadFromContext()

bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
protected

create target object from proxyBoneIdx synced from client

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

527 {
528 if ( !action_recive_data )
529 {
530 action_recive_data = new ActionReciveData;
531 }
532 Object actionTargetObject = null;
533 Object actionTargetParent = null;
534 int componentIndex = -1;
535 int proxyBoneIdx = -1;
536 vector cursorHitPos = vector.Zero;
537 ItemBase mainItem = null;
538
539 ref ActionTarget target;
540
541 if ( UseMainItem() )
542 {
543 if ( !ctx.Read(mainItem) )
544 return false;
545 }
546
547 if ( HasTarget() && !IsUsingProxies() )
548 {
549 if ( !ctx.Read(actionTargetObject) )
550 return false;
551
552 if ( !ctx.Read(actionTargetParent))
553 return false;
554
555 if ( !ctx.Read(componentIndex) )
556 return false;
557
558 if ( !ctx.Read(cursorHitPos) )
559 return false;
560
561 target = new ActionTarget(actionTargetObject, actionTargetParent, componentIndex, cursorHitPos, 0);
562
563 action_recive_data.m_Target = target;
564 }
565 else if( HasTarget() && IsUsingProxies() )
566 {
567 if ( !ctx.Read(proxyBoneIdx) )
568 return false;
569
570 if ( !ctx.Read(actionTargetParent))
571 return false;
572
573 if ( !ctx.Read(componentIndex) )
574 return false;
575
576 if ( !ctx.Read(cursorHitPos) )
577 return false;
578
580 if ( proxyBoneIdx > -1 )
581 {
582 Entity entParent = Entity.Cast(actionTargetParent);
583
584 if (entParent)
585 {
586 actionTargetObject = entParent.GetBoneObject(proxyBoneIdx);
587 }
588 }
589 else
590 {
591 return false;
592 }
593
594 target = new ActionTarget(actionTargetObject, actionTargetParent, componentIndex, cursorHitPos, 0);
595
596 action_recive_data.m_Target = target;
597 }
598
599 action_recive_data.m_MainItem = mainItem;
600 return true;
601 }
bool HasTarget()
Определения ActionBase.c:259
bool IsUsingProxies()
not using plane object - it's using multiple proxies
Определения ActionBase.c:300
bool UseMainItem()
Определения ActionBase.c:417
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:125
Определения Camera.c:2
Определения ObjectTyped.c:2
proto bool Read(void value_in)
static const vector Zero
Определения EnConvert.c:123
Определения EnConvert.c:119

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