@@ -23,12 +23,16 @@ define_dummy_symbol(mmai_aiVehicleOpponent);
23
23
#include " agi/dlptmpl.h"
24
24
#include " agi/getdlp.h"
25
25
#include " agiworld/quality.h"
26
+ #include " data7/str.h"
27
+ #include " mmcityinfo/vehlist.h"
26
28
27
29
#include " aiData.h"
28
30
#include " aiGoalBackup.h"
29
31
#include " aiGoalFollowWayPts.h"
30
32
#include " aiGoalStop.h"
31
33
34
+ static mem::cmd_param PARAM_maxoppcolors {" maxoppcolors" };
35
+
32
36
void aiVehicleOpponent::DrawDamage ()
33
37
{}
34
38
@@ -38,10 +42,10 @@ void aiVehicleOpponent::Init(i32 opp_id, aiRaceData* race_data, char* race_name)
38
42
if (agiRQ.TextureQuality )
39
43
--agiRQ.TextureQuality ;
40
44
41
- i32 paint_job = opp_id & 3 ;
42
- i32 index = opp_id + 1 ;
45
+ OpponentRaceData* opp = static_cast <OpponentRaceData*>(race_data->Opponents .Access (opp_id + 1 ));
43
46
44
- OpponentRaceData* opp = static_cast <OpponentRaceData*>(race_data->Opponents .Access (index ));
47
+ mmVehInfo* veh_info = VehList ()->GetVehicleInfo (opp->Model );
48
+ i32 paint_job = opp_id % PARAM_maxoppcolors.get_or (string (veh_info->Colors ).NumSubStrings ());
45
49
46
50
Car.Init (opp->Model , CAR_TYPE_OPPONENT, paint_job);
47
51
@@ -52,9 +56,7 @@ void aiVehicleOpponent::Init(i32 opp_id, aiRaceData* race_data, char* race_name)
52
56
53
57
WayPts = arnew aiGoalFollowWayPts (
54
58
opp->PathFile , &RailSet, this , &IsBackup, &IsFinished, &IsStopped, xconst (race_name), opp->MaxThrottle );
55
-
56
59
BackupGoal = arnew aiGoalBackup (&RailSet, &Car, &IsBackup);
57
-
58
60
StopGoal = arnew aiGoalStop (&Car, &IsStopped);
59
61
60
62
IsSemi = !std::strcmp (" vpsemi" , opp->Model );
@@ -71,5 +73,6 @@ void aiVehicleOpponent::Init(i32 opp_id, aiRaceData* race_data, char* race_name)
71
73
RailSet.BackBumperDist = max.z ;
72
74
RailSet.RSideDist = max.x ;
73
75
}
76
+
74
77
AudIndexNumber = -1 ;
75
78
}
0 commit comments