| 403 | } |
| 404 | |
| 405 | bool 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 | |
| 438 | static void ClearPlayerLookAroundActions(const ItemInfo& item) |
| 439 | { |
no outgoing calls
no test coverage detected