390 {
392 {
393 return super.ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished);
394 }
395
397
398 DayZCreatureAIInputController controller;
400
401 if (!input || !controller)
402 {
403 return super.ModCommandHandlerBefore(pDt, pCurrentCommandID, pCurrentCommandFinished);
404 }
405
407
408 float maxTurnSpeed = 100.0;
409 movementX = Math.Clamp(movementX * maxTurnSpeed * pDt, -180, 180);
410
412 {
413 movementX = 0;
414 }
415
418
421
423
424 int iAlert = 0;
425 float fAlert = 0;
426 int iSpeed = 0;
427 float fSpeed = 0;
428
429 if (isMove)
430 {
431 iAlert = 1;
432 fAlert = 0.2;
433
436 bool isWalk = !isSprint && !isJog;
437 if (isSprint)
438 {
440 iSpeed = 3;
441 }
442 else if (isJog)
443 {
445 iSpeed = 2;
446 }
447 else if (isWalk)
448 {
450 iSpeed = 1;
451 }
452 }
453
454 DayZAnimalInputController animalController;
455 if (Class.CastTo(animalController, controller))
456 {
459
460 if (!isMove)
461 {
462 if (isRest)
463 {
464 iSpeed = 0;
466 }
467
468 if (isSleep)
469 {
470 iSpeed = 0;
472 }
473 }
474 }
475
477 if (iSpeed > 0 && lowVel)
478 {
479 iAlert = 4;
480 fAlert = 1.0;
481
482 iSpeed = 3;
483 }
484
485 if (animalController)
486 {
487 switch (iSpeed)
488 {
489 case 0:
490 fSpeed = 0;
491 break;
492 case 1:
493 fSpeed = 2;
494 break;
495 case 2:
496 fSpeed = 3;
497 break;
498 case 3:
499 fSpeed = 5;
500 break;
501 }
502 }
503
508
510 {
512 }
513
514 return true;
515 }
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.