check for water depth while getting out and start swimming if necessary this also handles the last frame of the vehicle command hence it doens't need separate check on pCurrentCommandFinished
If we are not in fall command then something else is currently running and we can safely continue here, otherwise terminate here
2289 {
2291
2292 vector playerPosition = PhysicsGetPositionWS();
2293
2295 GetHumanInventory().Update(pDt);
2296
2298 {
2299 return;
2300 }
2301
2302 HumanCommandVehicle hcv;
2303
2304 HumanInputController hic = GetInputController();
2305 EntityAI entityInHands = GetEntityInHands();
2307
2309 bool isWeapon = entityInHands && entityInHands.IsInherited(Weapon);
2310
2311 bool updateAimingMdfr = false;
2313 {
2315 updateAimingMdfr = true;
2316 }
2317
2319 {
2320 updateAimingMdfr = true;
2322 }
2323
2324 if (updateAimingMdfr)
2325 {
2326 if (isRaisedNow && isWeapon)
2328 else
2330 }
2331
2332
2334
2335
2336 if (hic)
2337 {
2340 {
2342 bool exitIronSights = false;
2344 }
2346 {
2347 bool exitOptic = false;
2349 }
2350 }
2351
2354
2356 {
2359 }
2360
2363 {
2364 return;
2365 }
2366
2370 {
2371 HumanCommandVehicle cmdVehicle = GetCommand_Vehicle();
2373 {
2374 vector waterLevel;
2375 if (
m_Swimming.CheckSwimmingStart( waterLevel ) )
2376 {
2377
2379
2380 StartCommand_Swim();
2381 return;
2382 }
2383 }
2384 }
2385
2387 if (pCurrentCommandFinished)
2388 {
2390 {
2392 {
2397 return;
2398 }
2399 }
2400
2401
2402
2403
2404 if (PhysicsIsFalling(true))
2405 {
2406 StartCommand_Fall(0);
2408 return;
2409 }
2410
2413 {
2414 StartCommand_Swim();
2415 return;
2416 }
2417
2418 StartCommand_Move();
2419
2420 if (entityInHands)
2422
2423 return;
2424 }
2425
2426
2427
2429
2431 {
2432 return;
2433 }
2434
2435
2436
2437
2439 {
2440 hcv = GetCommand_Vehicle();
2442 {
2443 GearChangeActionCallback cb = GearChangeActionCallback.Cast(AddCommandModifier_Action(
DayZPlayerConstants.CMD_ACTIONMOD_SHIFTGEAR, GearChangeActionCallback));
2445 }
2446
2447 Transport transport;
2448 int seatPos;
2449
2452 if (IsAlive() && IsAuthority() && transport && transport.CrewShouldEject(seatPos))
2453 {
2454
2455
2457 GetGame().GetMission().MissionScript.CallFunction(
this,
"GetModifiersManager", mdfMan, null);
2458 mdfMan.ActivateModifier(
eModifiers.MDF_UNCONSCIOUSNESS);
2459 }
2460
2461 return;
2462 }
2463
2465
2468 {
2471 {
2474 }
2475 else
2477 }
2478 else
2479 {
2482 }
2483
2484
2485
2487 {
2489 {
2490 return;
2491 }
2492
2494 return;
2495 }
2496
2497
2498
2500 {
2502 return;
2503 }
2504
2505
2506
2508 {
2509 return;
2510 }
2511
2512
2513
2514
2516 {
2518 {
2521
2522 FallDamageData fallDamageData = new FallDamageData();
2524
2525
2527 {
2529 OnLand(pCurrentCommandID, fallDamageData);
2530 npar = type.GetNoiseParamsLandLight();
2532 }
2533 else if (fallDamageData.
m_Height < 3.0)
2534 {
2537 else
2539
2540 OnLand(pCurrentCommandID, fallDamageData);
2541 npar = type.GetNoiseParamsLandLight();
2543 }
2544 else if (fallDamageData.
m_Height < 5.0)
2545 {
2547 OnLand(pCurrentCommandID, fallDamageData);
2548 npar = type.GetNoiseParamsLandHeavy();
2550 }
2551 else
2552 {
2554 OnLand(pCurrentCommandID, fallDamageData);
2555 npar = type.GetNoiseParamsLandHeavy();
2557 }
2558
2560 {
2561 OnPlayerRecievedHit();
2562 }
2563
2566 }
2567
2570 {
2571 return;
2572 }
2573 }
2574 else if (PhysicsIsFalling(false))
2575 {
2576
2577 StartCommand_Fall(0);
2579 return;
2580 }
2581
2582
2583
2584
2585#ifndef NO_GUI
2586#ifdef DEVELOPER
2588
2590 {
2592
2594 hcls.m_fFwMaxDistance = 3;
2595 else
2596 hcls.m_fFwMaxDistance = 1.2;
2597
2598 SHumanCommandClimbResult ret;
2599
2602 }
2603
2604#endif
2605#endif
2606
2607
2609 {
2610 return;
2611 }
2612
2614
2615 bool force = false;
2616#ifndef NO_GUI
2617#ifdef DEVELOPER
2620#endif
2621#endif
2623
2624 if (amplitude > 0.1 || force)
2625 {
2626 if (ad)
2627 ad.SetTalking(true);
2628
2629
2631 {
2632 int now =
g_Game.GetTime();
2634 {
2636
2637 int voiceLevel =
g_Game.GetVoiceLevel(
this);
2639
2640
2642 switch (voiceLevel)
2643 {
2644 case VoiceLevelWhisper:
2645 vonpar = pt.GetNoiseParamsWhisper();
2646 break;
2647 case VoiceLevelTalk:
2648 vonpar = pt.GetNoiseParamsTalk();
2649 break;
2650 case VoiceLevelShout:
2651 vonpar = pt.GetNoiseParamsShout();
2652 break;
2653 }
2655 }
2656 }
2657 }
2658 else
2659 {
2660 if (ad)
2661 ad.SetTalking(false);
2662 }
2663
2664
2665
2666
2668
2669 if (hic)
2670 {
2673 m_Throwing.HandleThrowing(hic, hcw, entityInHands, pDt);
2674
2677 {
2679 {
2681 return;
2682 }
2683 }
2684 }
2685
2686
2689 {
2690 return;
2691 }
2692 }
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
void ModifiersManager(PlayerBase player)
class NoiseSystem NoiseParams()
StarlightOptic ItemOptics
ref DayZPlayerImplementJumpClimb m_JumpClimb
void SetFallYDiff(float value)
bool IsLanded(int pCurrentCommandID)
float m_SprintedTimePerStanceMin
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void HandleWeapons(float pDt, Entity pInHands, HumanInputController pInputs, out bool pExitIronSights)
ref DayZPlayerMeleeFightLogic_LightHeavy m_MeleeFightLogic
bool ProcessJumpOrClimb(float pDt, int pCurrentCommandID)
ref DayZPlayerImplementThrowing m_Throwing
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
bool m_ContinueFirearmMelee
bool IsAlreadyInFallingCommand(int pCurrentCommandID)
int m_LastCommandBeforeUnconscious
bool OnLand(int pCurrentCommandID, FallDamageData fallDamageData)
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void OnLadder(float delta_time, HumanMovementState pState)
called every command handler tick when player is on ladder
void OnMovementChanged()
Event, called when HumanMovementState.m_iMovement changes...walk, run, sprint, etc....
ref HumanMovementState m_MovementState
time step for gradual update of dead screen visibilibty up to full visbility [s]
ref DayZPlayerImplementFallDamage m_FallDamage
bool IsHandheldOpticsInUse()
DayZPlayerInventory GetDayZPlayerInventory()
bool HandleDeath(int pCurrentCommandID)
bool m_ProcessFirearmMeleeHit
void AddNoise(NoiseParams noisePar, float noiseMultiplier=1.0)
void HandleOptic(notnull ItemOptics optic, bool inHands, HumanInputController pInputs, out bool pExitOptics)
ref DayZPlayerImplementSwimming m_Swimming
Transport m_TransportCache
void SetVehicleCommand(HumanCommandVehicle hcv)
proto native float GetCurrentMovementSpeed()
0,1,2..3 idle, walk, run, sprint
proto native Transport GetTransport()
proto native void ProcessLeaveEvents()
proto native bool WasGearChange()
proto native int GetVehicleSeat()
proto native bool IsGettingOut()
void ForceStandUpForHeavyItems(notnull EntityAI item)
-------------— Forces player to stand up when swapping to heavy item ----------------------—
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
proto native DayZPlayerInstanceType GetInstanceType()
proto native float IsPlayerSpeaking()
-------------— speaking anim ----------------------—
DayZPlayerConstants
defined in C++
class HumanCommandMelee2 HumanCommandFall()
void HumanCommandWeapons()
class HumanCommandWeapons HumanCommandAdditives()
class SHumanCommandSwimSettings SHumanCommandClimbSettings()