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
2272 {
2274
2275 vector playerPosition = PhysicsGetPositionWS();
2276
2278 GetHumanInventory().Update(pDt);
2279
2281 {
2282 return;
2283 }
2284
2285 HumanInputController hic = GetInputController();
2286 EntityAI entityInHands = GetEntityInHands();
2288
2290 bool isWeapon = entityInHands && entityInHands.IsInherited(Weapon);
2291
2292 bool updateAimingMdfr = false;
2294 {
2296 updateAimingMdfr = true;
2297 }
2298
2300 {
2301 updateAimingMdfr = true;
2303 }
2304
2305 if (updateAimingMdfr)
2306 {
2307 if (isRaisedNow && isWeapon)
2309 else
2311 }
2312
2313
2315
2316
2317 if (hic)
2318 {
2321 {
2323 bool exitIronSights = false;
2325 }
2327 {
2328 bool exitOptic = false;
2330 }
2331 }
2332
2335
2337 {
2340 }
2341
2344 {
2345 return;
2346 }
2347
2351 {
2352 HumanCommandVehicle cmdVehicle = GetCommand_Vehicle();
2354 {
2355 vector waterLevel;
2356 if (
m_Swimming.CheckSwimmingStart( waterLevel ) )
2357 {
2358
2360
2361 StartCommand_Swim();
2362 return;
2363 }
2364 }
2365 }
2366
2368 if (pCurrentCommandFinished)
2369 {
2371 {
2373 {
2378 return;
2379 }
2380 }
2381
2382
2383
2384 if (PhysicsIsFalling(true))
2385 {
2386 StartCommand_Fall(0);
2388 return;
2389 }
2390
2393 {
2394 StartCommand_Swim();
2395 return;
2396 }
2397
2398 StartCommand_Move();
2399
2400 if (entityInHands)
2402
2403 return;
2404 }
2405
2406
2407
2409
2411 {
2412 return;
2413 }
2414
2415
2416
2417
2419 {
2420 HumanCommandVehicle hcv = GetCommand_Vehicle();
2422 {
2423 GearChangeActionCallback cb = GearChangeActionCallback.Cast(AddCommandModifier_Action(
DayZPlayerConstants.CMD_ACTIONMOD_SHIFTGEAR, GearChangeActionCallback));
2425 }
2426
2427 return;
2428 }
2429
2431
2434 {
2437 {
2440 }
2441 else
2443 }
2444 else
2445 {
2448 }
2449
2450
2451
2453 {
2455 {
2456 return;
2457 }
2458
2460 return;
2461 }
2462
2463
2464
2466 {
2468 return;
2469 }
2470
2471
2472
2474 {
2475 return;
2476 }
2477
2478
2479
2480
2482 {
2484 {
2487
2488 FallDamageData fallDamageData = new FallDamageData();
2490
2491
2493 {
2495 OnLand(pCurrentCommandID, fallDamageData);
2496 npar = type.GetNoiseParamsLandLight();
2497 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
g_Game.GetWeather()));
2498 }
2499 else if (fallDamageData.
m_Height < 3.0)
2500 {
2503 else
2505
2506 OnLand(pCurrentCommandID, fallDamageData);
2507 npar = type.GetNoiseParamsLandLight();
2508 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
g_Game.GetWeather()));
2509 }
2510 else if (fallDamageData.
m_Height < 5.0)
2511 {
2513 OnLand(pCurrentCommandID, fallDamageData);
2514 npar = type.GetNoiseParamsLandHeavy();
2515 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
g_Game.GetWeather()));
2516 }
2517 else
2518 {
2520 OnLand(pCurrentCommandID, fallDamageData);
2521 npar = type.GetNoiseParamsLandHeavy();
2522 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
g_Game.GetWeather()));
2523 }
2524
2526 {
2527 OnPlayerRecievedHit();
2528 }
2529
2532 }
2533
2536 {
2537 return;
2538 }
2539 }
2540 else if (PhysicsIsFalling(false))
2541 {
2542
2543 StartCommand_Fall(0);
2545 return;
2546 }
2547
2548
2549
2550
2551#ifndef NO_GUI
2552#ifdef DEVELOPER
2554
2556 {
2558
2560 hcls.m_fFwMaxDistance = 3;
2561 else
2562 hcls.m_fFwMaxDistance = 1.2;
2563
2564 SHumanCommandClimbResult ret;
2565
2568 }
2569
2570#endif
2571#endif
2572
2573
2575 {
2576 return;
2577 }
2578
2580
2581 bool force = false;
2582#ifndef NO_GUI
2583#ifdef DEVELOPER
2586#endif
2587#endif
2589
2590 if (amplitude > 0.1 || force)
2591 {
2592 if (ad)
2593 ad.SetTalking(true);
2594
2595
2597 {
2598 int now =
g_Game.GetTime();
2600 {
2602
2603 int voiceLevel =
g_Game.GetVoiceLevel(
this);
2605
2606
2608 switch (voiceLevel)
2609 {
2610 case VoiceLevelWhisper:
2611 vonpar = pt.GetNoiseParamsWhisper();
2612 break;
2613 case VoiceLevelTalk:
2614 vonpar = pt.GetNoiseParamsTalk();
2615 break;
2616 case VoiceLevelShout:
2617 vonpar = pt.GetNoiseParamsShout();
2618 break;
2619 }
2620 AddNoise(vonpar, NoiseAIEvaluate.GetNoiseReduction(
g_Game.GetWeather()));
2621 }
2622 }
2623 }
2624 else
2625 {
2626 if (ad)
2627 ad.SetTalking(false);
2628 }
2629
2630
2631
2632
2634
2635 if (hic)
2636 {
2639 m_Throwing.HandleThrowing(hic, hcw, entityInHands, pDt);
2640
2643 {
2645 {
2647 return;
2648 }
2649 }
2650 }
2651
2652
2655 {
2656 return;
2657 }
2658 }
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
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 void ProcessLeaveEvents()
proto native bool WasGearChange()
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()