From e200eb1a2f3d754b4e9748fa0bd5c934d81ac2a2 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 26 Jul 2019 18:48:14 +0200 Subject: CAutomobile effect stuff --- src/core/re3.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/re3.cpp b/src/core/re3.cpp index c2787bc3..35b3cfa4 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -150,6 +150,18 @@ FixCar(void) ((CAutomobile*)veh)->Fix(); } +static int engineStatus; +static void +SetEngineStatus(void) +{ + CVehicle *veh = FindPlayerVehicle(); + if(veh == nil) + return; + if(!veh->IsCar()) + return; + ((CAutomobile*)veh)->Damage.SetEngineStatus(engineStatus); +} + static void ToggleComedy(void) { @@ -300,7 +312,8 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); }); DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); }); - + DebugMenuAddVar("Debug", "Engine Status", &engineStatus, nil, 1, 0, 226, nil); + DebugMenuAddCmd("Debug", "Set Engine Status", SetEngineStatus); DebugMenuAddCmd("Debug", "Fix Car", FixCar); DebugMenuAddCmd("Debug", "Toggle Comedy Controls", ToggleComedy); DebugMenuAddCmd("Debug", "Place Car on Road", PlaceOnRoad); -- cgit v1.2.3