432 {
434 {
435 return super.ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished);
436 }
437
439
440 DayZCreatureAIInputController controller;
442
443 if (!input || !controller)
444 {
445 return super.ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished);
446 }
447
449
450 float maxTurnSpeed = 100.0;
451 movementX = Math.Clamp(movementX * maxTurnSpeed * pDt, -180, 180);
452
454 {
455 movementX = 0;
456 }
457
460
463
465
466 int iAlert = 0;
467 float fAlert = 0;
468 int iSpeed = 0;
469 float fSpeed = 0;
470
471 if (isMove)
472 {
473 iAlert = 1;
474 fAlert = 0.2;
475
478 bool isWalk = !isSprint && !isJog;
479 if (isSprint)
480 {
482 iSpeed = 3;
483 }
484 else if (isJog)
485 {
487 iSpeed = 2;
488 }
489 else if (isWalk)
490 {
492 iSpeed = 1;
493 }
494 }
495
496 DayZAnimalInputController animalController;
497 if (Class.CastTo(animalController, controller))
498 {
501
502 if (!isMove)
503 {
504 if (isRest)
505 {
506 iSpeed = 0;
508 }
509
510 if (isSleep)
511 {
512 iSpeed = 0;
514 }
515 }
516 }
517
519 if (iSpeed > 0 && lowVel)
520 {
521 iAlert = 4;
522 fAlert = 1.0;
523
524 iSpeed = 3;
525 }
526
527 if (animalController)
528 {
529 switch (iSpeed)
530 {
531 case 0:
532 fSpeed = 0;
533 break;
534 case 1:
535 fSpeed = 2;
536 break;
537 case 2:
538 fSpeed = 3;
539 break;
540 case 3:
541 fSpeed = 5;
542 break;
543 }
544 }
545
550
552 {
554 }
555
556 return true;
557 }
DayZPlayer m_CinematicPlayer
proto native float SyncedValue_ID(int action, bool check_focus=true)
Get action state.
proto native float Length()
Returns length of vector (magnitude)
proto native CGame GetGame()
proto volatile int CallFunction(Class inst, string function, out void returnVal, void parm)
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.