|
44 | 44 | } civPingTest; |
45 | 45 | #endif // DEBUG |
46 | 46 |
|
47 | | -char modelRandomList[] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 1, 0, 4 }; |
| 47 | +char modelRandomList[16] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 1, 0, 4 }; |
48 | 48 | u_char reservedSlots[MAX_CARS] = { 0 }; |
49 | 49 |
|
50 | 50 | int distFurthestCivCarSq = 0; |
@@ -1595,7 +1595,7 @@ int PingOutAllSpecialCivCars(void) |
1595 | 1595 |
|
1596 | 1596 | do |
1597 | 1597 | { |
1598 | | - if (lcp->controlType == CONTROL_TYPE_CIV_AI && MissionHeader->residentModels[lcp->ap.model] > 4) |
| 1598 | + if (lcp->controlType == CONTROL_TYPE_CIV_AI && missionResidentCarModels[lcp->ap.model] > 4) |
1599 | 1599 | PingOutCar(lcp); |
1600 | 1600 |
|
1601 | 1601 | lcp++; |
@@ -1786,22 +1786,19 @@ int CreateStationaryCivCar(int direction, int orientX, int orientZ, LONGVECTOR4* |
1786 | 1786 | unsigned char* slot; |
1787 | 1787 | CAR_DATA* newCar; |
1788 | 1788 | CAR_DATA* carCnt; |
1789 | | - int model; |
| 1789 | + int model, i; |
1790 | 1790 | EXTRA_CIV_DATA civDat; |
1791 | 1791 | LONGQUATERNION tmpQ; |
1792 | 1792 |
|
1793 | 1793 | model = -1; |
1794 | | - |
1795 | | - if (MissionHeader->residentModels[0] == externalModel) |
1796 | | - model = 0; |
1797 | | - else if (MissionHeader->residentModels[1] == externalModel) |
1798 | | - model = 1; |
1799 | | - else if (MissionHeader->residentModels[2] == externalModel) |
1800 | | - model = 2; |
1801 | | - else if (MissionHeader->residentModels[3] == externalModel) |
1802 | | - model = 3; |
1803 | | - else if (MissionHeader->residentModels[4] == externalModel) |
1804 | | - model = 4; |
| 1794 | + for(i = 0; i < MAX_CAR_RESIDENT_MODELS; ++i) |
| 1795 | + { |
| 1796 | + if (missionResidentCarModels[i] == externalModel) |
| 1797 | + { |
| 1798 | + model = i; |
| 1799 | + break; |
| 1800 | + } |
| 1801 | + } |
1805 | 1802 |
|
1806 | 1803 | if (model != -1) |
1807 | 1804 | { |
@@ -2172,18 +2169,27 @@ int PingInCivCar(int minPingInDist) |
2172 | 2169 | } |
2173 | 2170 |
|
2174 | 2171 | // check if special car is loaded and add it to random list |
2175 | | - if (specModelValid == 0 || allowSpecSpooling == 0 || MissionHeader->residentModels[4] == 12) |
| 2172 | + if ((specModelValid == 0 || allowSpecSpooling == 0 || missionResidentCarModels[MAX_CAR_RESIDENT_MODELS-1] == 12) && missionResidentCarModels[MAX_CAR_RESIDENT_MODELS-1] >= 8) |
2176 | 2173 | { |
| 2174 | +#if MAX_CAR_RESIDENT_MODELS == 6 |
| 2175 | + modelRandomList[15] = 4; |
| 2176 | +#else |
2177 | 2177 | modelRandomList[15] = 0; |
| 2178 | +#endif |
2178 | 2179 | modelRandomList[14] = 1; |
2179 | 2180 | } |
2180 | 2181 | else |
2181 | 2182 | { |
2182 | 2183 | modelRandomList[15] = 4; |
| 2184 | + |
| 2185 | +#if MAX_CAR_RESIDENT_MODELS == 6 |
| 2186 | + modelRandomList[14] = 4; |
| 2187 | +#else |
2183 | 2188 | modelRandomList[14] = 1; |
| 2189 | +#endif |
2184 | 2190 |
|
2185 | 2191 | if ((Random2(0) & 0x100) != 0) |
2186 | | - modelRandomList[14] = 4; |
| 2192 | + modelRandomList[14] = MAX_CAR_RESIDENT_MODELS-1; |
2187 | 2193 | } |
2188 | 2194 |
|
2189 | 2195 | // another change for Caine's compound |
@@ -2211,15 +2217,15 @@ int PingInCivCar(int minPingInDist) |
2211 | 2217 | } |
2212 | 2218 | else |
2213 | 2219 | { |
2214 | | - model = modelRandomList[Random2(0) & 0xf]; |
| 2220 | + model = modelRandomList[Random2(0) & 15]; |
2215 | 2221 | } |
2216 | 2222 |
|
2217 | 2223 | // force spawn limo nearby in Caine's Cash |
2218 | 2224 | if (minPingInDist == 666) |
2219 | 2225 | model = 4; |
2220 | 2226 |
|
2221 | 2227 | // select car color palette |
2222 | | - if (MissionHeader->residentModels[model] == 0 || MissionHeader->residentModels[model] > 4) |
| 2228 | + if (missionResidentCarModels[model] == 0 || missionResidentCarModels[model] > 4) |
2223 | 2229 | { |
2224 | 2230 | civDat.palette = 0; |
2225 | 2231 | } |
@@ -2886,12 +2892,7 @@ void SetUpCivCollFlags(void) |
2886 | 2892 | hornchanflag[i] = GetFreeChannel(); |
2887 | 2893 | SpuSetVoiceAR(hornchanflag[i], 27); |
2888 | 2894 |
|
2889 | | - if (cp0->ap.model == 4) |
2890 | | - sample = ResidentModelsBodge(); |
2891 | | - else if (cp0->ap.model < 3) |
2892 | | - sample = cp0->ap.model; |
2893 | | - else |
2894 | | - sample = cp0->ap.model - 1; |
| 2895 | + sample = GetCarBankSample(cp0->ap.model); |
2895 | 2896 |
|
2896 | 2897 | // [A] use tracking sound |
2897 | 2898 | Start3DTrackingSound(hornchanflag[i], SOUND_BANK_CARS, sample * 3 + 2, |
@@ -3298,7 +3299,7 @@ void CreateRoadblock(void) |
3298 | 3299 | noMoreCars = 0; |
3299 | 3300 | distAlongSegment = -5; |
3300 | 3301 | lbody = car_cosmetics[3].colBox.vz; |
3301 | | - externalCopModel = MissionHeader->residentModels[3]; |
| 3302 | + externalCopModel = missionResidentCarModels[3]; |
3302 | 3303 |
|
3303 | 3304 | // [A] use player instead of car |
3304 | 3305 | dir = player[0].dir; |
|
0 commit comments