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
2238 {
2240
2241 vector playerPosition = PhysicsGetPositionWS();
2242
2244 GetHumanInventory().Update(pDt);
2245
2247 {
2248 return;
2249 }
2250
2251 HumanInputController hic = GetInputController();
2252 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
2254
2256 bool isWeapon = entityInHands && entityInHands.IsInherited(Weapon);
2257
2258 bool updateAimingMdfr = false;
2260 {
2262 updateAimingMdfr = true;
2263 }
2264
2266 {
2267 updateAimingMdfr = true;
2269 }
2270
2271 if (updateAimingMdfr)
2272 {
2273 if (isRaisedNow && isWeapon)
2275 else
2277 }
2278
2279
2281
2282
2283 if (hic)
2284 {
2287 {
2289 bool exitIronSights = false;
2291 }
2293 {
2294 bool exitOptic = false;
2296 }
2297 }
2298
2301
2303 {
2306 }
2307
2310 {
2311 return;
2312 }
2313
2317 {
2318 HumanCommandVehicle cmdVehicle = GetCommand_Vehicle();
2320 {
2321 vector waterLevel;
2322 if (
m_Swimming.CheckSwimmingStart( waterLevel ) )
2323 {
2324
2326
2327 StartCommand_Swim();
2328 return;
2329 }
2330 }
2331 }
2332
2334 if (pCurrentCommandFinished)
2335 {
2337 {
2339 {
2344 return;
2345 }
2346 }
2347
2348
2349
2350 if (PhysicsIsFalling(true))
2351 {
2352 StartCommand_Fall(0);
2354 return;
2355 }
2356
2359 {
2360 StartCommand_Swim();
2361 return;
2362 }
2363
2364 StartCommand_Move();
2365
2366 if (GetHumanInventory().GetEntityInHands())
2368
2369 return;
2370 }
2371
2372
2373
2375
2377 {
2378 return;
2379 }
2380
2381
2382
2383
2385 {
2386 HumanCommandVehicle hcv = GetCommand_Vehicle();
2388 {
2389 GearChangeActionCallback cb = GearChangeActionCallback.Cast(AddCommandModifier_Action(
DayZPlayerConstants.CMD_ACTIONMOD_SHIFTGEAR, GearChangeActionCallback));
2391 }
2392
2393 return;
2394 }
2395
2397
2400 {
2403 {
2406 }
2407 else
2409 }
2410 else
2411 {
2414 }
2415
2416
2417
2419 {
2421 {
2422 return;
2423 }
2424
2426 return;
2427 }
2428
2429
2430
2432 {
2434 return;
2435 }
2436
2437
2438
2440 {
2441 return;
2442 }
2443
2444
2445
2446
2448 {
2450 {
2453
2454 FallDamageData fallDamageData = new FallDamageData();
2456
2457
2459 {
2461 OnLand(pCurrentCommandID, fallDamageData);
2462 npar = type.GetNoiseParamsLandLight();
2463 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2464 }
2465 else if (fallDamageData.
m_Height < 3.0)
2466 {
2469 else
2471
2472 OnLand(pCurrentCommandID, fallDamageData);
2473 npar = type.GetNoiseParamsLandLight();
2474 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2475 }
2476 else if (fallDamageData.
m_Height < 5.0)
2477 {
2479 OnLand(pCurrentCommandID, fallDamageData);
2480 npar = type.GetNoiseParamsLandHeavy();
2481 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2482 }
2483 else
2484 {
2486 OnLand(pCurrentCommandID, fallDamageData);
2487 npar = type.GetNoiseParamsLandHeavy();
2488 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2489 }
2490
2492 {
2493 OnPlayerRecievedHit();
2494 }
2495
2498 }
2499
2502 {
2503 return;
2504 }
2505 }
2506 else if (PhysicsIsFalling(false))
2507 {
2508
2509 StartCommand_Fall(0);
2511 return;
2512 }
2513
2514
2515
2516
2517#ifndef NO_GUI
2518#ifdef DEVELOPER
2520
2522 {
2524
2526 hcls.m_fFwMaxDistance = 3;
2527 else
2528 hcls.m_fFwMaxDistance = 1.2;
2529
2530 SHumanCommandClimbResult ret;
2531
2534 }
2535
2536#endif
2537#endif
2538
2539
2541 {
2542 return;
2543 }
2544
2546
2547 bool force = false;
2548#ifndef NO_GUI
2549#ifdef DEVELOPER
2552#endif
2553#endif
2555
2556 if (amplitude > 0.1 || force)
2557 {
2558 if (ad)
2559 ad.SetTalking(true);
2560
2561
2563 {
2566 {
2568
2571
2572
2574 switch (voiceLevel)
2575 {
2576 case VoiceLevelWhisper:
2577 vonpar = pt.GetNoiseParamsWhisper();
2578 break;
2579 case VoiceLevelTalk:
2580 vonpar = pt.GetNoiseParamsTalk();
2581 break;
2582 case VoiceLevelShout:
2583 vonpar = pt.GetNoiseParamsShout();
2584 break;
2585 }
2586 AddNoise(vonpar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2587 }
2588 }
2589 }
2590 else
2591 {
2592 if (ad)
2593 ad.SetTalking(false);
2594 }
2595
2596
2597
2598
2600
2601 if (hic)
2602 {
2605 m_Throwing.HandleThrowing(hic, hcw, entityInHands, pDt);
2606
2609 {
2611 {
2613 return;
2614 }
2615 }
2616 }
2617
2618
2621 {
2622 return;
2623 }
2624 }
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
class NoiseSystem NoiseParams()
StarlightOptic ItemOptics
proto native int GetVoiceLevel(Object player=null)
Get voice level of VoN (on both client and server) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
proto int GetTime()
returns mission time in milliseconds
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++
proto native CGame GetGame()
class HumanCommandMelee2 HumanCommandFall()
void HumanCommandWeapons()
class HumanCommandWeapons HumanCommandAdditives()
class SHumanCommandSwimSettings SHumanCommandClimbSettings()