MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / CanPlayerLookAround

Function CanPlayerLookAround

TombEngine/Game/Lara/lara_helpers.cpp:405–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405bool CanPlayerLookAround(const ItemInfo& item)
406{
407 const auto& player = GetLaraInfo(item);
408
409 // 1) Check if look mode is not None.
410 if (player.Control.Look.Mode == LookMode::None)
411 return false;
412
413 // 2) Check if drawn weapon has lasersight.
414 if (player.Control.HandStatus == HandStatus::WeaponReady &&
415 player.Weapons[(int)player.Control.Weapon.GunType].HasLasersight)
416 {
417 return true;
418 }
419
420 // 3) Test for switchable target.
421 if (player.Control.HandStatus == HandStatus::WeaponReady &&
422 player.TargetEntity != nullptr)
423 {
424 unsigned int targetableCount = 0;
425 for (const auto* targetPtr : player.TargetList)
426 {
427 if (targetPtr != nullptr)
428 targetableCount++;
429
430 if (targetableCount > 1)
431 return false;
432 }
433 }
434
435 return true;
436}
437
438static void ClearPlayerLookAroundActions(const ItemInfo& item)
439{

Callers 7

lara_as_monkey_idleFunction · 0.85
LaraAboveWaterFunction · 0.85
LaraWaterSurfaceFunction · 0.85
LaraUnderwaterFunction · 0.85
lara_as_idleFunction · 0.85
lara_as_crouch_idleFunction · 0.85
lara_as_crawl_idleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected