|
12 | 12 | #define Offset_m_bDisabled 980 |
13 | 13 | #define Offset_m_bPlayerStateA 960 |
14 | 14 | #define Offset_m_bPlayerStateB 961 |
| 15 | +#define Offset_m_flFOV 1736 |
15 | 16 | #else |
16 | 17 | #define Offset_m_iTouchingPortalCount 1148 |
17 | 18 | #define Offset_m_bDisabled 1004 |
18 | 19 | #define Offset_m_bPlayerStateA 984 |
19 | 20 | #define Offset_m_bPlayerStateB 985 |
| 21 | +#define Offset_m_flFOV 1760 |
20 | 22 | #endif |
21 | 23 |
|
22 | 24 | SAR_RULE(view_change, "sp_a1_intro1", "player", "CBasePlayer", m_hViewEntity, SearchMode::Classes) |
@@ -79,5 +81,29 @@ SAR_RULE3(gate_opens, "mp_coop_paint_crazy_box", "coopman_airlock_success", Sear |
79 | 81 | return TimerAction::DoNothing; |
80 | 82 | } |
81 | 83 |
|
82 | | -SAR_CATEGORY(Portal2, RTA, _Rules({ &view_change, &moon_shot })); |
| 84 | +SAR_RULE(gain_control, "e1912", "player", "CBasePlayer", m_hVehicle, SearchMode::Classes) |
| 85 | +{ |
| 86 | + // Wait some ticks till we get into the vehicle |
| 87 | + if (engine->GetSessionTick() > 13 && *m_hVehicle == -1) { |
| 88 | + return TimerAction::Start; |
| 89 | + } |
| 90 | + |
| 91 | + return TimerAction::DoNothing; |
| 92 | +} |
| 93 | + |
| 94 | +SAR_RULE3(vehicle_lock, "e1912", "crash-vehicle_outro", SearchMode::Names) |
| 95 | +{ |
| 96 | + // CPropVehicleChoreoGeneric aka prop_vehicle_choreo_generic |
| 97 | + // m_savedVehicleView.flFOV |
| 98 | + auto flFOV = reinterpret_cast<float*>((uintptr_t)entity + Offset_m_flFOV); |
| 99 | + |
| 100 | + if (*flFOV != 0) { |
| 101 | + return TimerAction::End; |
| 102 | + } |
| 103 | + |
| 104 | + return TimerAction::DoNothing; |
| 105 | +} |
| 106 | + |
| 107 | +SAR_CATEGORY(Portal2, RTA, _Rules({ &view_change, &moon_shot })); |
83 | 108 | SAR_CATEGORY(Portal2, CoopRTA, _Rules({ &players_teleport, &players_taunt, &gate_opens })); |
| 109 | +SAR_CATEGORY(Portal2, Super8, _Rules({ &gain_control, &vehicle_lock })); |
0 commit comments