From 54af95b39e5edb0170337b00d873df87f6f2c9d6 Mon Sep 17 00:00:00 2001 From: Robin Kisman <99972691+KcRobin9@users.noreply.github.com> Date: Thu, 9 May 2024 07:27:39 +0200 Subject: [PATCH] Customize max opponent colors when using -maxoppcolors (closes #102) --- code/midtown/mmai/aiVehicleOpponent.cpp | 5 ++--- docs/setup.md | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/midtown/mmai/aiVehicleOpponent.cpp b/code/midtown/mmai/aiVehicleOpponent.cpp index 18a2c4bf..6d0136c0 100644 --- a/code/midtown/mmai/aiVehicleOpponent.cpp +++ b/code/midtown/mmai/aiVehicleOpponent.cpp @@ -24,7 +24,6 @@ define_dummy_symbol(mmai_aiVehicleOpponent); #include "agi/getdlp.h" #include "agiworld/quality.h" #include "data7/str.h" -#include "mmcityinfo/vehinfo.h" #include "mmcityinfo/vehlist.h" #include "aiData.h" @@ -32,7 +31,7 @@ define_dummy_symbol(mmai_aiVehicleOpponent); #include "aiGoalFollowWayPts.h" #include "aiGoalStop.h" -static mem::cmd_param PARAM_opp_color_count {"colorcount"}; +static mem::cmd_param PARAM_maxoppcolors {"maxoppcolors"}; void aiVehicleOpponent::DrawDamage() {} @@ -46,7 +45,7 @@ void aiVehicleOpponent::Init(i32 opp_id, aiRaceData* race_data, char* race_name) OpponentRaceData* opp = static_cast(race_data->Opponents.Access(opp_id + 1)); mmVehInfo* veh_info = VehList()->GetVehicleInfo(opp->Model); - i32 paint_job = opp_id % PARAM_opp_color_count.get_or(string(veh_info->Colors).NumSubStrings()); + i32 paint_job = opp_id % PARAM_maxoppcolors.get_or(string(veh_info->Colors).NumSubStrings()); Car.Init(opp->Model, CAR_TYPE_OPPONENT, paint_job); diff --git a/docs/setup.md b/docs/setup.md index a250be35..14f28c8f 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -40,6 +40,7 @@ For a tutorial on how to use command line arguments, click [here](https://www.bl | allrace | false | Unlocks All Races | | maxcops | 3 | Max cops chasing you at once | | nodamage | false | Disables Damage | +| maxoppcolors | auto | Cycles through the opponent car colors based on the number of paintjobs available | ## Basic