| 14 | using namespace TEN::Effects::Environment; |
| 15 | |
| 16 | void ControlTeleporter(short itemNumber) |
| 17 | { |
| 18 | ItemInfo* item = &g_Level.Items[itemNumber]; |
| 19 | |
| 20 | if (!TriggerActive(item)) |
| 21 | return; |
| 22 | |
| 23 | Lara.Control.IsLocked = false; |
| 24 | |
| 25 | if (item->TriggerFlags == 666) |
| 26 | { |
| 27 | if (item->ItemFlags[0] == 70) |
| 28 | { |
| 29 | SoundEffect(SFX_TR5_LIFT_HIT_FLOOR1, nullptr); |
| 30 | SoundEffect(SFX_TR5_LIFT_HIT_FLOOR2, nullptr); |
| 31 | } |
| 32 | |
| 33 | SetAnimation(LaraItem, LA_ELEVATOR_RECOVER); |
| 34 | |
| 35 | item->ItemFlags[0]++; |
| 36 | if (item->ItemFlags[0] >= 150) |
| 37 | KillItem(itemNumber); |
| 38 | } |
| 39 | else |
| 40 | { |
| 41 | Camera.fixedCamera = true; |
| 42 | LaraItem->DisableInterpolation = true; |
| 43 | LaraItem->Pose.Position.x = item->Pose.Position.x; |
| 44 | LaraItem->Pose.Position.z = item->Pose.Position.z; |
| 45 | LaraItem->Pose.Orientation.y = item->Pose.Orientation.y - ANGLE(180.0f); |
| 46 | |
| 47 | auto& pointColl = GetPointCollision(*item); |
| 48 | LaraItem->Pose.Position.y = pointColl.GetPosition().y; |
| 49 | |
| 50 | if (LaraItem->RoomNumber != pointColl.GetRoomNumber()) |
| 51 | { |
| 52 | ItemNewRoom(LaraItem->Index, pointColl.GetRoomNumber()); |
| 53 | LaraItem->Location.RoomNumber = pointColl.GetRoomNumber(); |
| 54 | } |
| 55 | |
| 56 | if (item->Flags & IFLAG_INVISIBLE) |
| 57 | { |
| 58 | KillItem(itemNumber); |
| 59 | } |
| 60 | else if (item->TriggerFlags != 512) |
| 61 | { |
| 62 | RemoveActiveItem(itemNumber); |
| 63 | item->Flags &= 0xC1FFu; |
| 64 | } |
| 65 | } |
| 66 | } |
nothing calls this directly
no test coverage detected