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
2175 {
2177
2178 vector playerPosition = PhysicsGetPositionWS();
2179
2181 {
2182 return;
2183 }
2184
2185 HumanInputController hic = GetInputController();
2186 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
2188
2190 bool isWeapon = entityInHands && entityInHands.IsInherited(Weapon);
2191
2192 bool updateAimingMdfr = false;
2194 {
2196 updateAimingMdfr = true;
2197 }
2198
2200 {
2201 updateAimingMdfr = true;
2203 }
2204
2205 if (updateAimingMdfr)
2206 {
2207 if (isRaisedNow && isWeapon)
2209 else
2211 }
2212
2213
2215
2216
2217 if (hic)
2218 {
2219 ItemOptics opticInHands = ItemOptics.Cast(entityInHands);
2221 {
2223 bool exitIronSights = false;
2225 }
2227 {
2228 bool exitOptic = false;
2230 }
2231 }
2232
2235
2237 {
2240 }
2241
2244 {
2245 return;
2246 }
2247
2251 {
2252 HumanCommandVehicle cmdVehicle = GetCommand_Vehicle();
2254 {
2255 vector waterLevel;
2256 if (
m_Swimming.CheckSwimmingStart( waterLevel ) )
2257 {
2258
2260
2261 StartCommand_Swim();
2262 return;
2263 }
2264 }
2265 }
2266
2268 if (pCurrentCommandFinished)
2269 {
2271 {
2273 {
2278 return;
2279 }
2280 }
2281
2282
2283
2284 if (PhysicsIsFalling(true))
2285 {
2286 StartCommand_Fall(0);
2288 return;
2289 }
2290
2293 {
2294 StartCommand_Swim();
2295 return;
2296 }
2297
2298 StartCommand_Move();
2299
2300 if (GetHumanInventory().GetEntityInHands())
2302
2303 return;
2304 }
2305
2306
2307
2309
2311 {
2312 return;
2313 }
2314
2315
2316
2317
2319 {
2320 HumanCommandVehicle hcv = GetCommand_Vehicle();
2322 {
2323 GearChangeActionCallback cb = GearChangeActionCallback.Cast(AddCommandModifier_Action(
DayZPlayerConstants.CMD_ACTIONMOD_SHIFTGEAR, GearChangeActionCallback));
2325 }
2326
2327 return;
2328 }
2329
2331
2334 {
2337 {
2340 }
2341 else
2343 }
2344 else
2345 {
2348 }
2349
2350
2351
2353 {
2355 {
2356 return;
2357 }
2358
2360 return;
2361 }
2362
2363
2364
2366 {
2368 return;
2369 }
2370
2371
2372
2374 {
2375 return;
2376 }
2377
2378
2379
2380
2382 {
2384 {
2387
2388 FallDamageData fallDamageData = new FallDamageData();
2390
2391
2393 {
2395 OnLand(pCurrentCommandID, fallDamageData);
2396 npar = type.GetNoiseParamsLandLight();
2397 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2398 }
2399 else if (fallDamageData.
m_Height < 3.0)
2400 {
2403 else
2405
2406 OnLand(pCurrentCommandID, fallDamageData);
2407 npar = type.GetNoiseParamsLandLight();
2408 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2409 }
2410 else if (fallDamageData.
m_Height < 5.0)
2411 {
2413 OnLand(pCurrentCommandID, fallDamageData);
2414 npar = type.GetNoiseParamsLandHeavy();
2415 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2416 }
2417 else
2418 {
2420 OnLand(pCurrentCommandID, fallDamageData);
2421 npar = type.GetNoiseParamsLandHeavy();
2422 AddNoise(npar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2423 }
2424
2426 {
2427 OnPlayerRecievedHit();
2428 }
2429
2432 }
2433
2436 {
2437 return;
2438 }
2439 }
2440 else if (PhysicsIsFalling(false))
2441 {
2442
2443 StartCommand_Fall(0);
2445 return;
2446 }
2447
2448
2449
2450
2451#ifndef NO_GUI
2452#ifdef DEVELOPER
2454
2456 {
2458
2460 hcls.m_fFwMaxDistance = 3;
2461 else
2462 hcls.m_fFwMaxDistance = 1.2;
2463
2464 SHumanCommandClimbResult ret;
2465
2468 }
2469
2470#endif
2471#endif
2472
2473
2475 {
2476 return;
2477 }
2478
2480
2481 bool force = false;
2482#ifndef NO_GUI
2483#ifdef DEVELOPER
2486#endif
2487#endif
2489
2490 if (amplitude > 0.1 || force)
2491 {
2492 if (ad)
2493 ad.SetTalking(true);
2494
2495
2497 {
2500 {
2502
2505
2506
2508 switch (voiceLevel)
2509 {
2510 case VoiceLevelWhisper:
2511 vonpar = pt.GetNoiseParamsWhisper();
2512 break;
2513 case VoiceLevelTalk:
2514 vonpar = pt.GetNoiseParamsTalk();
2515 break;
2516 case VoiceLevelShout:
2517 vonpar = pt.GetNoiseParamsShout();
2518 break;
2519 }
2520 AddNoise(vonpar, NoiseAIEvaluate.GetNoiseReduction(
GetGame().GetWeather()));
2521 }
2522 }
2523 }
2524 else
2525 {
2526 if (ad)
2527 ad.SetTalking(false);
2528 }
2529
2530
2531
2532
2534
2535 if (hic)
2536 {
2539 m_Throwing.HandleThrowing(hic, hcw, entityInHands, pDt);
2540
2543 {
2545 {
2547 return;
2548 }
2549 }
2550 }
2551
2552
2555 {
2556 return;
2557 }
2558 }
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
class NoiseSystem NoiseParams()
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()
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()