diff --git a/code/midtown/mmcar/car.cpp b/code/midtown/mmcar/car.cpp index 8a5d5692..9c612c23 100644 --- a/code/midtown/mmcar/car.cpp +++ b/code/midtown/mmcar/car.cpp @@ -24,12 +24,24 @@ define_dummy_symbol(mmcar_car); #include "agi/getdlp.h" #include "data7/timer.h" #include "mmcity/cullcity.h" +#include "mmcityinfo/state.h" #include "mmcityinfo/vehlist.h" #include "mmphysics/joint3dof.h" #include "playercaraudio.h" #include "trailer.h" +static mem::cmd_param PARAM_aiphysics {"aiphysics"}; + +void mmCar::ApplyAiPhysics() +{ + if (!Sim.FrontLeft.OnGround && !Sim.FrontRight.OnGround && !Sim.BackLeft.OnGround && !Sim.BackRight.OnGround) + { + Sim.ICS.AngularMomentum *= 0.1f; + CHEATING = true; + } +} + mmCar::mmCar() { // FIXME: mmCar is already oversampled by mmPhysicsMGR @@ -65,6 +77,9 @@ void mmCar::Update() OverSample.Update(); + if (PARAM_aiphysics && MMSTATE.NetworkStatus == 0) + ApplyAiPhysics(); + #ifdef ARTS_DEV_BUILD f32 elapsed = t.Time(); mmCar::UpdateTime += elapsed; diff --git a/code/midtown/mmcar/car.h b/code/midtown/mmcar/car.h index fe8db6ba..f36442db 100644 --- a/code/midtown/mmcar/car.h +++ b/code/midtown/mmcar/car.h @@ -145,6 +145,8 @@ class mmCar final : public mmPhysEntity // ?DeclareFields@mmCar@@SAXXZ ARTS_IMPORT static void DeclareFields(); + void ApplyAiPhysics(); + #ifdef ARTS_DEV_BUILD // ?PostUpdateTime@mmCar@@2MA ARTS_IMPORT static f32 PostUpdateTime; diff --git a/docs/setup.md b/docs/setup.md index 14f28c8f..79d632fa 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -36,6 +36,7 @@ For a tutorial on how to use command line arguments, click [here](https://www.bl | Name | Value | Description | | ---------- | ----- | --- | +| aiphysics | false | Sets AI-like physics midair | allcars | false | Unlocks All Cars | | allrace | false | Unlocks All Races | | maxcops | 3 | Max cops chasing you at once |