Skip to content

Commit

Permalink
Customize max opponent colors when using -maxoppcolors (closes #102)
Browse files Browse the repository at this point in the history
  • Loading branch information
KcRobin9 committed May 9, 2024
1 parent a06281d commit 54af95b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions code/midtown/mmai/aiVehicleOpponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ 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"
#include "aiGoalBackup.h"
#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()
{}
Expand All @@ -46,7 +45,7 @@ void aiVehicleOpponent::Init(i32 opp_id, aiRaceData* race_data, char* race_name)
OpponentRaceData* opp = static_cast<OpponentRaceData*>(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);

Expand Down
1 change: 1 addition & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 54af95b

Please sign in to comment.