DayZ 1.28
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 строка 493

494 {
495 if (!action_recive_data)
496 action_recive_data = new ActionReciveData;
497
498 Object actionTargetObject = null;
499 Object actionTargetParent = null;
500 int componentIndex = -1;
501 int proxyBoneIdx = -1;
502 vector cursorHitPos = vector.Zero;
503 ItemBase mainItem = null;
504
505 ActionTarget target;
506 string surfaceName;
507
508 if (UseMainItem())
509 {
510 if (!ctx.Read(mainItem))
511 return false;
512 }
513
514 if (HasTarget() && !IsUsingProxies())
515 {
516 if (!ctx.Read(actionTargetObject))
517 return false;
518
519 if (!ctx.Read(actionTargetParent))
520 return false;
521
522 if (!ctx.Read(componentIndex))
523 return false;
524
525 if (!ctx.Read(cursorHitPos))
526 return false;
527
528 if (!ctx.Read(surfaceName))
529 return false;
530
531 target = new ActionTarget(actionTargetObject, actionTargetParent, componentIndex, cursorHitPos, 0, surfaceName);
532
533 action_recive_data.m_Target = target;
534 }
535 else if (HasTarget() && IsUsingProxies())
536 {
537 if (!ctx.Read(proxyBoneIdx))
538 return false;
539
540 if (!ctx.Read(actionTargetParent))
541 return false;
542
543 if (!ctx.Read(componentIndex))
544 return false;
545
546 if (!ctx.Read(cursorHitPos))
547 return false;
548
549 if (!ctx.Read(surfaceName))
550 return false;
551
553 if (proxyBoneIdx > -1)
554 {
555 Entity entParent = Entity.Cast(actionTargetParent);
556
557 if (entParent)
558 {
559 actionTargetObject = entParent.GetBoneObject(proxyBoneIdx);
560 }
561 }
562 else
563 {
564 return false;
565 }
566
567 target = new ActionTarget(actionTargetObject, actionTargetParent, componentIndex, cursorHitPos, 0, surfaceName);
568
569 action_recive_data.m_Target = target;
570 }
571
572 action_recive_data.m_MainItem = mainItem;
573 return true;
574 }
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:121
class GP5GasMask extends MaskBase ItemBase
bool HasTarget()
Определения ActionBase.c:244
bool UseMainItem()
Определения ActionBase.c:385
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().