VC vehicles just barely working now

This commit is contained in:
aap 2020-05-07 11:33:20 +02:00
parent a8d8c0690d
commit 05a1d64fbb
28 changed files with 444 additions and 259 deletions

View File

@ -100,13 +100,13 @@ enum eVehicleModel {
LINERUN,
PEREN,
SENTINEL,
PATRIOT,
RIO,
FIRETRUK,
TRASH,
STRETCH,
MANANA,
INFERNUS,
BLISTA,
VOODOO,
PONY,
MULE,
CHEETAH,
@ -115,11 +115,11 @@ enum eVehicleModel {
MOONBEAM,
ESPERANT,
TAXI,
KURUMA,
WASHING,
BOBCAT,
MRWHOOP,
BFINJECT,
CORPSE,
HUNTER,
POLICE,
ENFORCER,
SECURICA,
@ -128,42 +128,83 @@ enum eVehicleModel {
BUS,
RHINO,
BARRACKS,
TRAIN,
CUBAN,
CHOPPER,
DODO,
ANGEL,
COACH,
CABBIE,
STALLION,
RUMPO,
RCBANDIT,
BELLYUP,
MRWONGS,
MAFIA,
YARDIE,
YAKUZA,
DIABLOS,
COLUMB,
HOODS,
ROMERO,
PACKER,
SENTXS,
ADMIRAL,
SQUALO,
SEASPAR,
PIZZABOY,
GANGBUR,
AIRTRAIN,
DEADDODO,
SPEEDER,
REEFER,
PANLANT,
TROPIC,
FLATBED,
YANKEE,
ESCAPE,
BORGNINE,
TOYZ,
GHOST,
CAR151,
CAR152,
CAR153,
CAR154,
CAR155,
CAR156,
CAR157,
CAR158,
CAR159,
CADDY,
ZEBRA,
TOPFUN,
SKIMMER,
PCJ600,
FAGGIO,
FREEWAY,
RCBARON,
RCRAIDER,
GLENDALE,
OCEANIC,
SANCHEZ,
SPARROW,
PATRIOT,
LOVEFIST,
COASTG,
DINGHY,
HERMES,
SABRE,
SABRETUR,
PHEONIX,
WALTON,
REGINA,
COMET,
DELUXO,
BURRITO,
SPAND,
MARQUIS,
BAGGAGE,
KAUFMAN,
MAVERICK,
VCNMAV,
RANCHER,
FBIRANCH,
VIRGO,
GREENWOO,
JETMAX,
HOTRING,
SANDKING,
BLISTAC,
POLMAV,
BOXVILLE,
BENSON,
MESA,
RCGOBLIN,
HOTRINA,
HOTRINB,
BLOODRA,
BLOODRB,
VICECHEE,
// HACK so this compiles
// TODO(MIAMI): check it out
DODO = -1
};
enum PLAY_STATUS : uint8 { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING = 1, PLAY_STATUS_FINISHED = 2 };
@ -7103,7 +7144,8 @@ struct tVehicleSampleData {
uint8 m_bDoorType;
};
const tVehicleSampleData aVehicleSettings[70] = {{SFX_CAR_REV_2, 2, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1},
// TODO(MIAMI): this is bogus. get the real data in here!
const tVehicleSampleData aVehicleSettings[110] = {{SFX_CAR_REV_2, 2, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_ALARM_1, 9935, 1},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 11487, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_8, 8, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_ALARM_1, 10928, 1},
{SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_ALARM_1, 9935, 2},
@ -7172,6 +7214,46 @@ const tVehicleSampleData aVehicleSettings[70] = {{SFX_CAR_REV_2, 2, SFX_CAR_HORN
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0},
{SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_ALARM_1, 9935, 0}};
void
@ -7989,7 +8071,7 @@ cAudioManager::ProcessVehicle(CVehicle *veh)
if (handling)
params.m_pTransmission = &handling->Transmission;
params.m_nIndex = veh->GetModelIndex() - 90;
params.m_nIndex = veh->GetModelIndex() - MI_FIRST_VEHICLE;
if (params.m_pVehicle->GetStatus() == STATUS_SIMPLE)
velChange = params.m_pVehicle->AutoPilot.m_fMaxTrafficSpeed * 0.02f;
else

View File

@ -66,7 +66,8 @@ cMusicManager::PlayerInCar()
case MI_TRAIN:
case MI_SPEEDER:
case MI_REEFER:
case MI_GHOST: return false;
// case MI_GHOST:
return false;
default: return true;
}
}

View File

@ -541,39 +541,41 @@ cAudioManager::SetupSuspectLastSeenReport()
color_pre_modifier = gCarColourTable[color1][0];
color_post_modifier = gCarColourTable[color1][2];
switch (veh->GetModelIndex()) {
// TODO(MIAMI): just making this compile
#ifdef FIX_BUGS
case MI_COLUMB:
main_color = SFX_POLICE_RADIO_BLUE;
color_pre_modifier = color_post_modifier = TOTAL_AUDIO_SAMPLES;
// case MI_COLUMB:
// main_color = SFX_POLICE_RADIO_BLUE;
// color_pre_modifier = color_post_modifier = TOTAL_AUDIO_SAMPLES;
#endif
case MI_LANDSTAL:
case MI_BLISTA: sample = SFX_POLICE_RADIO_CRUISER; break;
// case MI_BLISTA:
sample = SFX_POLICE_RADIO_CRUISER; break;
#ifdef FIX_BUGS
case MI_YARDIE:
color_pre_modifier = TOTAL_AUDIO_SAMPLES;
main_color = SFX_POLICE_RADIO_RED;
color_post_modifier = SFX_POLICE_RADIO_YELLOW;
sample = SFX_POLICE_RADIO_CONVERTIBLE; break;
case MI_DIABLOS:
main_color = SFX_POLICE_RADIO_BLACK;
// case MI_YARDIE:
// color_pre_modifier = TOTAL_AUDIO_SAMPLES;
// main_color = SFX_POLICE_RADIO_RED;
// color_post_modifier = SFX_POLICE_RADIO_YELLOW;
// sample = SFX_POLICE_RADIO_CONVERTIBLE; break;
// case MI_DIABLOS:
// main_color = SFX_POLICE_RADIO_BLACK;
#endif
case MI_IDAHO:
case MI_STALLION: sample = SFX_POLICE_RADIO_CONVERTIBLE; break;
#ifdef FIX_BUGS
case MI_YAKUZA:
color_pre_modifier = TOTAL_AUDIO_SAMPLES;
main_color = SFX_POLICE_RADIO_SILVER;
color_post_modifier = SFX_POLICE_RADIO_RED;
// case MI_YAKUZA:
// color_pre_modifier = TOTAL_AUDIO_SAMPLES;
// main_color = SFX_POLICE_RADIO_SILVER;
// color_post_modifier = SFX_POLICE_RADIO_RED;
#endif
case MI_STINGER:
case MI_INFERNUS:
case MI_CHEETAH:
case MI_BANSHEE: sample = SFX_POLICE_RADIO_SPORTS_CAR; break;
#ifdef FIX_BUGS
case MI_MAFIA:
color_pre_modifier = color_post_modifier = TOTAL_AUDIO_SAMPLES;
main_color = SFX_POLICE_RADIO_GREY;
case MI_KURUMA:
// case MI_MAFIA:
// color_pre_modifier = color_post_modifier = TOTAL_AUDIO_SAMPLES;
// main_color = SFX_POLICE_RADIO_GREY;
case MI_WASHING:
#endif
case MI_PEREN:
case MI_SENTINEL:
@ -588,21 +590,18 @@ cAudioManager::SetupSuspectLastSeenReport()
case MI_TRASH:
case MI_BARRACKS: sample = SFX_POLICE_RADIO_TRUCK; break;
case MI_STRETCH: sample = SFX_POLICE_RADIO_LIMO; break;
#ifdef FIX_BUGS
case MI_CORPSE:
#endif
case MI_MANANA:
case MI_ESPERANT: sample = SFX_POLICE_RADIO_2_DOOR; break;
#ifdef FIX_BUGS
case MI_HOODS:
color_pre_modifier = TOTAL_AUDIO_SAMPLES;
main_color = SFX_POLICE_RADIO_BLUE;
color_post_modifier = SFX_POLICE_RADIO_GREEN;
case MI_BELLYUP:
// case MI_HOODS:
// color_pre_modifier = TOTAL_AUDIO_SAMPLES;
// main_color = SFX_POLICE_RADIO_BLUE;
// color_post_modifier = SFX_POLICE_RADIO_GREEN;
// case MI_BELLYUP:
case MI_YANKEE:
case MI_TOYZ:
case MI_MRWONGS:
case MI_PANLANT:
case MI_TOPFUN:
// case MI_MRWONGS:
// case MI_PANLANT:
#endif
case MI_PONY:
case MI_MULE:
@ -613,7 +612,8 @@ cAudioManager::SetupSuspectLastSeenReport()
case MI_AMBULAN: sample = SFX_POLICE_RADIO_AMBULANCE; break;
case MI_TAXI:
case MI_CABBIE:
case MI_BORGNINE: sample = SFX_POLICE_RADIO_TAXI; break;
case MI_ZEBRA: sample = SFX_POLICE_RADIO_TAXI; break;
case MI_KAUFMAN: sample = SFX_POLICE_RADIO_TAXI; break;
case MI_MRWHOOP:
sample = SFX_POLICE_RADIO_ICE_CREAM_VAN;
break;
@ -622,7 +622,7 @@ cAudioManager::SetupSuspectLastSeenReport()
#ifdef FIX_BUGS
case MI_SPEEDER:
case MI_REEFER:
case MI_GHOST:
// case MI_GHOST:
#endif
case MI_PREDATOR: sample = SFX_POLICE_RADIO_BOAT; break;
case MI_BUS:

View File

@ -302,9 +302,14 @@ CCarCtrl::GenerateOneRandomCar()
case RICH:
case EXEC:
case WORKER:
case SPECIAL:
case BIG:
case TAXI:
// TODO(MIAMI): check this
case MOPED:
case MOTORBIKE:
case LEISUREBOAT:
case WORKERBOAT:
//
case MAFIA:
case TRIAD:
case DIABLO:
@ -318,7 +323,7 @@ CCarCtrl::GenerateOneRandomCar()
pCar->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(9, 14);
if (carClass == EXEC)
pCar->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(12, 18);
else if (carClass == POOR || carClass == SPECIAL)
else if (carClass == POOR)
pCar->AutoPilot.m_nCruiseSpeed = CGeneral::GetRandomNumberInRange(7, 10);
CVehicleModelInfo* pVehicleInfo = pCar->GetModelInfo();
if (pVehicleInfo->GetColModel()->boundingBox.max.y - pCar->GetModelInfo()->GetColModel()->boundingBox.min.y > 10.0f || carClass == BIG) {
@ -475,7 +480,12 @@ CCarCtrl::GenerateOneRandomCar()
case RICH:
case EXEC:
case WORKER:
case SPECIAL:
// TODO(MIAMI): check this
case MOPED:
case MOTORBIKE:
case LEISUREBOAT:
case WORKERBOAT:
//
case BIG:
case TAXI:
case MAFIA:
@ -550,16 +560,17 @@ CCarCtrl::ChooseModel(CZoneInfo* pZone, CVector* pPos, int* pClass) {
int32 model = -1;
while (model == -1 || !CStreaming::HasModelLoaded(model)){
int rnd = CGeneral::GetRandomNumberInRange(0, 1000);
// TODO(MIAMI): new car classes
if (rnd < pZone->carThreshold[0])
model = CCarCtrl::ChooseCarModel((*pClass = POOR));
model = CCarCtrl::ChooseCarModel((*pClass = NORMAL));
else if (rnd < pZone->carThreshold[1])
model = CCarCtrl::ChooseCarModel((*pClass = RICH));
model = CCarCtrl::ChooseCarModel((*pClass = POOR));
else if (rnd < pZone->carThreshold[2])
model = CCarCtrl::ChooseCarModel((*pClass = EXEC));
model = CCarCtrl::ChooseCarModel((*pClass = RICH));
else if (rnd < pZone->carThreshold[3])
model = CCarCtrl::ChooseCarModel((*pClass = WORKER));
model = CCarCtrl::ChooseCarModel((*pClass = EXEC));
else if (rnd < pZone->carThreshold[4])
model = CCarCtrl::ChooseCarModel((*pClass = SPECIAL));
model = CCarCtrl::ChooseCarModel((*pClass = WORKER));
else if (rnd < pZone->carThreshold[5])
model = CCarCtrl::ChooseCarModel((*pClass = BIG));
else if (rnd < pZone->copThreshold)
@ -597,7 +608,12 @@ CCarCtrl::ChooseCarModel(int32 vehclass)
case RICH:
case EXEC:
case WORKER:
case SPECIAL:
// TODO(MIAMI): check this
case MOPED:
case MOTORBIKE:
case LEISUREBOAT:
case WORKERBOAT:
//
case BIG:
case TAXI:
{

View File

@ -23,14 +23,19 @@ enum{
class CCarCtrl
{
public:
enum eCarClass {
POOR = 0,
NORMAL = 0,
POOR,
RICH,
EXEC,
WORKER,
SPECIAL,
BIG,
TAXI,
MOPED,
MOTORBIKE,
LEISUREBOAT,
WORKERBOAT,
TOTAL_CUSTOM_CLASSES,
MAFIA,
TRIAD,
@ -43,7 +48,7 @@ class CCarCtrl
GANG9,
COPS
};
public:
static void SwitchVehicleToRealPhysics(CVehicle*);
static void AddToCarArray(int32 id, int32 vehclass);
static void UpdateCarCount(CVehicle*, bool);

View File

@ -106,8 +106,9 @@
const int32 gaCarsToCollectInCraigsGarages[TOTAL_COLLECTCARS_GARAGES][TOTAL_COLLECTCARS_CARS] =
{
{ MI_SECURICA, MI_MOONBEAM, MI_COACH, MI_FLATBED, MI_LINERUN, MI_TRASH, MI_PATRIOT, MI_MRWHOOP, MI_BLISTA, MI_MULE, MI_YANKEE, MI_BOBCAT, MI_DODO, MI_BUS, MI_RUMPO, MI_PONY },
{ MI_SENTINEL, MI_CHEETAH, MI_BANSHEE, MI_IDAHO, MI_INFERNUS, MI_TAXI, MI_KURUMA, MI_STRETCH, MI_PEREN, MI_STINGER, MI_MANANA, MI_LANDSTAL, MI_STALLION, MI_BFINJECT, MI_CABBIE, MI_ESPERANT },
// TODO(MIAMI): bogus
{ MI_SECURICA, MI_MOONBEAM, MI_COACH, MI_FLATBED, MI_LINERUN, MI_TRASH, MI_PATRIOT, MI_MRWHOOP, MI_BLISTAC, MI_MULE, MI_YANKEE, MI_BOBCAT, MI_DODO, MI_BUS, MI_RUMPO, MI_PONY },
{ MI_SENTINEL, MI_CHEETAH, MI_BANSHEE, MI_IDAHO, MI_INFERNUS, MI_TAXI, MI_WASHING, MI_STRETCH, MI_PEREN, MI_STINGER, MI_MANANA, MI_LANDSTAL, MI_STALLION, MI_BFINJECT, MI_CABBIE, MI_ESPERANT },
{ MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_CHEETAH, MI_TAXI, MI_ESPERANT, MI_SENTINEL, MI_IDAHO }
};
@ -1612,8 +1613,6 @@ bool CGarages::HasThisCarBeenCollected(int16 garage, uint8 id)
bool CGarage::DoesCraigNeedThisCar(int32 mi)
{
if (mi == MI_CORPSE)
mi = MI_MANANA;
int ct = CGarages::GetCarsCollectedIndexForGarageType(m_eGarageType);
for (int i = 0; i < TOTAL_COLLECTCARS_CARS; i++) {
if (mi == gaCarsToCollectInCraigsGarages[ct][i])
@ -1624,8 +1623,6 @@ bool CGarage::DoesCraigNeedThisCar(int32 mi)
bool CGarage::HasCraigCollectedThisCar(int32 mi)
{
if (mi == MI_CORPSE)
mi = MI_MANANA;
int ct = CGarages::GetCarsCollectedIndexForGarageType(m_eGarageType);
for (int i = 0; i < TOTAL_COLLECTCARS_CARS; i++) {
if (mi == gaCarsToCollectInCraigsGarages[ct][i])
@ -1636,8 +1633,6 @@ bool CGarage::HasCraigCollectedThisCar(int32 mi)
bool CGarage::MarkThisCarAsCollectedForCraig(int32 mi)
{
if (mi == MI_CORPSE)
mi = MI_MANANA;
int ct = CGarages::GetCarsCollectedIndexForGarageType(m_eGarageType);
int index;
for (index = 0; index < TOTAL_COLLECTCARS_CARS; index++) {

View File

@ -835,13 +835,14 @@ bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, flo
CStreaming::RequestModel(mi, 0);
}
else {
// TODO(MIAMI): don't hardcode model indices
if (mi == MI_DEADDODO || mi == MI_AIRTRAIN) {
new_v = new(vp->index << 8) CPlane(mi, 2);
}
else if (mi == MI_TRAIN) {
new_v = new(vp->index << 8) CTrain(mi, 2);
}
else if (mi == MI_CHOPPER || mi == MI_ESCAPE) {
else if (mi == MI_CHOPPER) {
new_v = new(vp->index << 8) CHeli(mi, 2);
}
else if (CModelInfo::IsBoatModel(mi)){

View File

@ -5346,8 +5346,7 @@ int8 CRunningScript::ProcessCommands600To699(int32 command)
CollectParameters(&m_nIp, 1);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle);
int mi = pVehicle->GetModelIndex();
UpdateCompareFlag(mi == MI_TAXI || mi == MI_CABBIE || mi == MI_BORGNINE);
UpdateCompareFlag(pVehicle->IsTaxi());
return 0;
}
case COMMAND_UNLOAD_SPECIAL_CHARACTER:
@ -8159,7 +8158,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
case MI_FBICAR:
case MI_MRWHOOP:
case MI_BFINJECT:
case MI_CORPSE:
// case MI_CORPSE:
case MI_POLICE:
case MI_ENFORCER:
case MI_SECURICA:
@ -8172,27 +8171,27 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
case MI_DODO:
case MI_COACH:
case MI_RCBANDIT:
case MI_BELLYUP:
case MI_MRWONGS:
case MI_MAFIA:
case MI_YARDIE:
case MI_YAKUZA:
case MI_DIABLOS:
case MI_COLUMB:
case MI_HOODS:
// case MI_BELLYUP:
// case MI_MRWONGS:
// case MI_MAFIA:
case MI_VOODOO:
// case MI_YAKUZA:
// case MI_DIABLOS:
// case MI_COLUMB:
// case MI_HOODS:
case MI_AIRTRAIN:
case MI_DEADDODO:
case MI_SPEEDER:
case MI_REEFER:
case MI_PANLANT:
// case MI_PANLANT:
case MI_FLATBED:
case MI_YANKEE:
case MI_ESCAPE:
case MI_BORGNINE:
case MI_TOYZ:
case MI_GHOST:
case MI_MIAMI_RCBARON:
case MI_MIAMI_RCRAIDER:
// case MI_ESCAPE:
case MI_ZEBRA:
case MI_TOPFUN:
// case MI_GHOST:
case MI_RCBARON:
case MI_RCRAIDER:
model = -1;
break;
case MI_IDAHO:
@ -8202,13 +8201,13 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
case MI_PATRIOT:
case MI_MANANA:
case MI_INFERNUS:
case MI_BLISTA:
// case MI_BLISTA:
case MI_PONY:
case MI_CHEETAH:
case MI_MOONBEAM:
case MI_ESPERANT:
case MI_TAXI:
case MI_KURUMA:
case MI_WASHING:
case MI_BOBCAT:
case MI_BANSHEE:
case MI_CABBIE:

View File

@ -4907,7 +4907,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
bool correctAlpha = true;
// if (SA checks if we aren't in work car, why?) {
if (!isCar || car->GetModelIndex() != MI_YARDIE) {
if (!isCar || car->GetModelIndex() != MI_VOODOO) {
correctAlpha = false;
}
else {

View File

@ -781,21 +781,22 @@ CFileLoader::LoadVehicleObject(const char *line)
{
int id;
char model[24], txd[24];
char type[8], handlingId[16], gamename[32], vehclass[12];
char type[8], handlingId[16], gamename[32], anims[16], vehclass[12];
uint32 frequency, comprules;
int32 level, misc;
float wheelScale;
CVehicleModelInfo *mi;
char *p;
sscanf(line, "%d %s %s %s %s %s %s %d %d %x %d %f",
sscanf(line, "%d %s %s %s %s %s %s %s %d %d %x %d %f",
&id, model, txd,
type, handlingId, gamename, vehclass,
type, handlingId, gamename, anims, vehclass,
&frequency, &level, &comprules, &misc, &wheelScale);
mi = CModelInfo::AddVehicleModel(id);
mi->SetName(model);
mi->SetTexDictionary(txd);
// TODO(MIAMI): anims
for(p = gamename; *p; p++)
if(*p == '_') *p = ' ';
strncpy(mi->m_gameName, gamename, 32);
@ -826,34 +827,52 @@ CFileLoader::LoadVehicleObject(const char *line)
mi->m_handlingId = mod_HandlingManager.GetHandlingId(handlingId);
// Well this is kinda dumb....
if(strncmp(vehclass, "poorfamily", 11) == 0){
mi->m_vehicleClass = VEHICLE_CLASS_POOR;
if(strncmp(vehclass, "normal", 7) == 0){
mi->m_vehicleClass = CCarCtrl::NORMAL;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, VEHICLE_CLASS_POOR);
CCarCtrl::AddToCarArray(id, CCarCtrl::NORMAL);
}else if(strncmp(vehclass, "poorfamily", 11) == 0){
mi->m_vehicleClass = CCarCtrl::POOR;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, CCarCtrl::POOR);
}else if(strncmp(vehclass, "richfamily", 11) == 0){
mi->m_vehicleClass = VEHICLE_CLASS_RICH;
mi->m_vehicleClass = CCarCtrl::RICH;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, VEHICLE_CLASS_RICH);
CCarCtrl::AddToCarArray(id, CCarCtrl::RICH);
}else if(strncmp(vehclass, "executive", 10) == 0){
mi->m_vehicleClass = VEHICLE_CLASS_EXECUTIVE;
mi->m_vehicleClass = CCarCtrl::EXEC;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, VEHICLE_CLASS_EXECUTIVE);
CCarCtrl::AddToCarArray(id, CCarCtrl::EXEC);
}else if(strncmp(vehclass, "worker", 7) == 0){
mi->m_vehicleClass = VEHICLE_CLASS_WORKER;
mi->m_vehicleClass = CCarCtrl::WORKER;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, VEHICLE_CLASS_WORKER);
}else if(strncmp(vehclass, "special", 8) == 0){
mi->m_vehicleClass = VEHICLE_CLASS_SPECIAL;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, VEHICLE_CLASS_SPECIAL);
CCarCtrl::AddToCarArray(id, CCarCtrl::WORKER);
}else if(strncmp(vehclass, "big", 4) == 0){
mi->m_vehicleClass = VEHICLE_CLASS_BIG;
mi->m_vehicleClass = CCarCtrl::BIG;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, VEHICLE_CLASS_BIG);
CCarCtrl::AddToCarArray(id, CCarCtrl::BIG);
}else if(strncmp(vehclass, "taxi", 5) == 0){
mi->m_vehicleClass = VEHICLE_CLASS_TAXI;
mi->m_vehicleClass = CCarCtrl::TAXI;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, VEHICLE_CLASS_TAXI);
CCarCtrl::AddToCarArray(id, CCarCtrl::TAXI);
}else if(strncmp(vehclass, "moped", 6) == 0){
mi->m_vehicleClass = CCarCtrl::MOPED;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, CCarCtrl::MOPED);
}else if(strncmp(vehclass, "motorbike", 10) == 0){
mi->m_vehicleClass = CCarCtrl::MOTORBIKE;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, CCarCtrl::MOTORBIKE);
}else if(strncmp(vehclass, "leisureboat", 12) == 0){
mi->m_vehicleClass = CCarCtrl::LEISUREBOAT;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, CCarCtrl::LEISUREBOAT);
}else if(strncmp(vehclass, "workerboat", 11) == 0){
mi->m_vehicleClass = CCarCtrl::WORKERBOAT;
while(frequency-- > 0)
CCarCtrl::AddToCarArray(id, CCarCtrl::WORKERBOAT);
}else if(strncmp(vehclass, "ignore", 11) == 0){
mi->m_vehicleClass = -1;
}
}

View File

@ -354,7 +354,7 @@ CPlayerInfo::Process(void)
bool startTaxiTimer = true;
if (m_bUnusedTaxiThing && m_pPed->bInVehicle) {
CVehicle *veh = m_pPed->m_pMyVehicle;
if ((veh->GetModelIndex() == MI_TAXI || veh->GetModelIndex() == MI_CABBIE || veh->GetModelIndex() == MI_BORGNINE)
if (veh->IsTaxi()
&& veh->pDriver == m_pPed && veh->m_nNumPassengers != 0) {
for (uint32 timePassed = CTimer::GetTimeInMilliseconds() - m_nUnusedTaxiTimer; timePassed >= 1000; m_nUnusedTaxiTimer += 1000) {
timePassed -= 1000;

View File

@ -1285,8 +1285,11 @@ CStreaming::StreamVehiclesAndPeds(void)
else if(ms_numVehiclesLoaded <= desiredNumVehiclesLoaded){
for(i = 1; i <= 10; i++){
model = CCarCtrl::ChooseCarModel(modelQualityClass);
// TODO(MIAMI): check this
if(model < 0)
continue;
modelQualityClass++;
if(modelQualityClass >= NUM_VEHICLE_CLASSES)
if(modelQualityClass >= CCarCtrl::TOTAL_CUSTOM_CLASSES)
modelQualityClass = 0;
// check if we want to load this model
@ -1374,6 +1377,10 @@ CStreaming::StreamZoneModels(const CVector &pos)
ms_loadedGangs &= ~bit;
}
// TODO(MIAMI): check this
if(CGangs::GetGangInfo(i)->m_nVehicleMI < 0)
continue;
if(gangCarsToLoad & bit && (ms_loadedGangCars & bit) == 0){
RequestModel(CGangs::GetGangInfo(i)->m_nVehicleMI, STREAMFLAGS_DONT_REMOVE);
}else if((gangCarsToLoad & bit) == 0 && ms_loadedGangCars & bit){

View File

@ -61,7 +61,7 @@ enum Config {
// Cull zones
NUMATTRIBZONES = 704,
NUMHANDLINGS = 57,
NUMHANDLINGS = 106,
PATHNODESIZE = 4500,

View File

@ -193,11 +193,17 @@ ResetCamStatics(void)
}
static const char *carnames[] = {
"landstal", "idaho", "stinger", "linerun", "peren", "sentinel", "patriot", "firetruk", "trash", "stretch", "manana", "infernus", "blista", "pony",
"mule", "cheetah", "ambulan", "fbicar", "moonbeam", "esperant", "taxi", "kuruma", "bobcat", "mrwhoop", "bfinject", "corpse", "police", "enforcer",
"securica", "banshee", "predator", "bus", "rhino", "barracks", "train", "chopper", "dodo", "coach", "cabbie", "stallion", "rumpo", "rcbandit",
"bellyup", "mrwongs", "mafia", "yardie", "yakuza", "diablos", "columb", "hoods", "airtrain", "deaddodo", "speeder", "reefer", "panlant", "flatbed",
"yankee", "escape", "borgnine", "toyz", "ghost",
"landstal", "idaho", "stinger", "linerun", "peren", "sentinel" "rio", "firetruk", "trash", "stretch", "manana",
"infernus", "voodoo", "pony", "mule", "cheetah", "ambulan", "fbicar", "moonbeam", "esperant", "taxi", "washing",
"bobcat", "mrwhoop", "bfinject", "hunter", "police", "enforcer", "securica", "banshee", "predator", "bus",
"rhino", "barracks", "cuban", "chopper", "angel", "coach", "cabbie", "stallion", "rumpo", "rcbandit", "romero",
"packer", "sentxs", "admiral", "squalo", "seaspar", "pizzaboy", "gangbur", "airtrain", "deaddodo", "speeder",
"reefer", "tropic", "flatbed", "yankee", "caddy", "zebra", "topfun", "skimmer", "pcj600", "faggio", "freeway",
"rcbaron", "rcraider", "glendale", "oceanic", "sanchez", "sparrow", "patriot", "lovefist", "coastg", "dinghy",
"hermes", "sabre", "sabretur", "pheonix", "walton", "regina", "comet", "deluxo", "burrito", "spand", "marquis",
"baggage", "kaufman", "maverick", "vcnmav", "rancher", "fbiranch", "virgo", "greenwoo", "jetmax", "hotring",
"sandking", "blistac", "polmav", "boxville", "benson", "mesa", "rcgoblin", "hotrina", "hotrinb",
"bloodra", "bloodrb", "vicechee",
};
static std::list<CTweakVar *> TweakVarsList;
@ -292,14 +298,12 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Cheats", "Nasty limbs", NastyLimbsCheat);
static int spawnCarId = MI_LANDSTAL;
e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_GHOST, carnames);
e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_VICECHEE, carnames);
DebugMenuEntrySetWrap(e, true);
DebugMenuAddCmd("Spawn", "Spawn Car", [](){
if(spawnCarId == MI_TRAIN ||
spawnCarId == MI_CHOPPER ||
if(spawnCarId == MI_CHOPPER ||
spawnCarId == MI_AIRTRAIN ||
spawnCarId == MI_DEADDODO ||
spawnCarId == MI_ESCAPE)
spawnCarId == MI_DEADDODO)
return;
SpawnCar(spawnCarId);
});
@ -311,13 +315,13 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Spawn", "Spawn Cheetah", [](){ SpawnCar(MI_CHEETAH); });
DebugMenuAddCmd("Spawn", "Spawn Esperanto", [](){ SpawnCar(MI_ESPERANT); });
DebugMenuAddCmd("Spawn", "Spawn Stallion", [](){ SpawnCar(MI_STALLION); });
DebugMenuAddCmd("Spawn", "Spawn Kuruma", [](){ SpawnCar(MI_KURUMA); });
DebugMenuAddCmd("Spawn", "Spawn Washington", [](){ SpawnCar(MI_WASHING); });
DebugMenuAddCmd("Spawn", "Spawn Taxi", [](){ SpawnCar(MI_TAXI); });
DebugMenuAddCmd("Spawn", "Spawn Police", [](){ SpawnCar(MI_POLICE); });
DebugMenuAddCmd("Spawn", "Spawn Enforcer", [](){ SpawnCar(MI_ENFORCER); });
DebugMenuAddCmd("Spawn", "Spawn Banshee", [](){ SpawnCar(MI_BANSHEE); });
DebugMenuAddCmd("Spawn", "Spawn Yakuza", [](){ SpawnCar(MI_YAKUZA); });
DebugMenuAddCmd("Spawn", "Spawn Yardie", [](){ SpawnCar(MI_YARDIE); });
DebugMenuAddCmd("Spawn", "Spawn Cuban", [](){ SpawnCar(MI_CUBAN); });
DebugMenuAddCmd("Spawn", "Spawn Voodoo", [](){ SpawnCar(MI_VOODOO); });
DebugMenuAddCmd("Spawn", "Spawn Dodo", [](){ SpawnCar(MI_DODO); });
DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); });
DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); });

View File

@ -1528,7 +1528,8 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
if(A->GetModelIndex() == MI_RCBANDIT)
adhesion *= 0.2f;
else if(IsBoatModel(A->GetModelIndex())){
// TODO(MIAMI): check this
else if(A->IsVehicle() && ((CVehicle*)A)->IsBoat()){
if(aColPoints[i].normal.z > 0.6f){
if(CSurfaceTable::GetAdhesionGroup(aColPoints[i].surfaceB) == ADHESIVE_LOOSE)
adhesion *= 3.0f;

View File

@ -257,19 +257,20 @@ enum
MI_BUSKER4,
// three more peds possible
MI_LANDSTAL = 130,
MI_FIRST_VEHICLE = 130,
MI_LANDSTAL = MI_FIRST_VEHICLE,
MI_IDAHO,
MI_STINGER,
MI_LINERUN,
MI_PEREN,
MI_SENTINEL,
MI_PATRIOT,
MI_RIO,
MI_FIRETRUCK,
MI_TRASH,
MI_STRETCH,
MI_MANANA,
MI_INFERNUS,
MI_BLISTA,
MI_VOODOO,
MI_PONY,
MI_MULE,
MI_CHEETAH,
@ -278,11 +279,11 @@ enum
MI_MOONBEAM,
MI_ESPERANT,
MI_TAXI,
MI_KURUMA,
MI_WASHING,
MI_BOBCAT,
MI_MRWHOOP,
MI_BFINJECT,
MI_CORPSE,
MI_HUNTER,
MI_POLICE,
MI_ENFORCER,
MI_SECURICA,
@ -291,38 +292,82 @@ enum
MI_BUS,
MI_RHINO,
MI_BARRACKS,
MI_TRAIN,
MI_CUBAN,
MI_CHOPPER,
MI_DODO,
MI_ANGEL,
MI_COACH,
MI_CABBIE,
MI_STALLION,
MI_RUMPO,
MI_RCBANDIT,
MI_BELLYUP,
MI_MRWONGS,
MI_MAFIA,
MI_YARDIE,
MI_YAKUZA,
MI_DIABLOS,
MI_COLUMB ,
MI_HOODS,
MI_ROMERO,
MI_PACKER,
MI_SENTXS,
MI_ADMIRAL,
MI_SQUALO,
MI_SEASPAR,
MI_PIZZABOY,
MI_GANGBUR,
MI_AIRTRAIN,
MI_DEADDODO,
MI_SPEEDER,
MI_REEFER,
MI_PANLANT,
MI_TROPIC,
MI_FLATBED,
MI_YANKEE,
MI_ESCAPE,
MI_BORGNINE,
MI_TOYZ,
MI_GHOST,
// leftovers on PC
MI_MIAMI_RCBARON = 194,
MI_MIAMI_RCRAIDER = 195,
MI_MIAMI_SPARROW = 199,
MI_CADDY,
MI_ZEBRA,
MI_TOPFUN,
MI_SKIMMER,
MI_PCJ600,
MI_FAGGIO,
MI_FREEWAY,
MI_RCBARON,
MI_RCRAIDER,
MI_GLENDALE,
MI_OCEANIC,
MI_SANCHEZ,
MI_SPARROW,
MI_PATRIOT,
MI_LOVEFIST,
MI_COASTG,
MI_DINGHY,
MI_HERMES,
MI_SABRE,
MI_SABRETUR,
MI_PHEONIX,
MI_WALTON,
MI_REGINA,
MI_COMET,
MI_DELUXO,
MI_BURRITO,
MI_SPAND,
MI_MARQUIS,
MI_BAGGAGE,
MI_KAUFMAN,
MI_MAVERICK,
MI_VCNMAV,
MI_RANCHER,
MI_FBIRANCH,
MI_VIRGO,
MI_GREENWOO,
MI_JETMAX,
MI_HOTRING,
MI_SANDKING,
MI_BLISTAC,
MI_POLMAV,
MI_BOXVILLE,
MI_BENSON,
MI_MESA,
MI_RCGOBLIN,
MI_HOTRINA,
MI_HOTRINB,
MI_BLOODRA,
MI_BLOODRB,
MI_VICECHEE,
// HACK
MI_TRAIN = -1,
MI_DODO = -2,
MI_GRENADE = 258,
MI_AK47,
@ -393,6 +438,7 @@ IsBodyPart(int16 id)
}
// This is bad and should perhaps not be used
/*
inline bool
IsBoatModel(int16 id)
{
@ -401,6 +447,7 @@ IsBoatModel(int16 id)
id == MI_SPEEDER ||
id == MI_GHOST;
}
*/
inline bool
IsPedModel(int16 id)

View File

@ -35,17 +35,6 @@ enum eVehicleType {
NUM_VEHICLE_TYPES
};
enum {
VEHICLE_CLASS_POOR,
VEHICLE_CLASS_RICH,
VEHICLE_CLASS_EXECUTIVE,
VEHICLE_CLASS_WORKER,
VEHICLE_CLASS_SPECIAL,
VEHICLE_CLASS_BIG,
VEHICLE_CLASS_TAXI,
NUM_VEHICLE_CLASSES
};
enum {
NUM_VEHICLE_POSITIONS = 10
};

View File

@ -15,13 +15,13 @@ CGangInfo::CGangInfo() :
void CGangs::Initialise(void)
{
Gang[GANG_MAFIA].m_nVehicleMI = MI_MAFIA;
Gang[GANG_TRIAD].m_nVehicleMI = MI_BELLYUP;
Gang[GANG_DIABLOS].m_nVehicleMI = MI_DIABLOS;
Gang[GANG_YAKUZA].m_nVehicleMI = MI_YAKUZA;
Gang[GANG_YARDIE].m_nVehicleMI = MI_YARDIE;
Gang[GANG_COLUMB].m_nVehicleMI = MI_COLUMB;
Gang[GANG_HOODS].m_nVehicleMI = MI_HOODS;
Gang[GANG_MAFIA].m_nVehicleMI = -1;
Gang[GANG_TRIAD].m_nVehicleMI = -1;
Gang[GANG_DIABLOS].m_nVehicleMI = -1;
Gang[GANG_YAKUZA].m_nVehicleMI = -1;
Gang[GANG_YARDIE].m_nVehicleMI = -1;
Gang[GANG_COLUMB].m_nVehicleMI = -1;
Gang[GANG_HOODS].m_nVehicleMI = -1;
Gang[GANG_7].m_nVehicleMI = -1;
Gang[GANG_8].m_nVehicleMI = -1;
#ifdef FIX_BUGS

View File

@ -11976,7 +11976,7 @@ CPed::RegisterThreatWithGangPeds(CEntity *attacker)
}
if (attackerPed && attackerPed->IsPlayer() && (attackerPed->m_nPedState == PED_CARJACK || attackerPed->bInVehicle)) {
if (!attackerPed->m_pMyVehicle || attackerPed->m_pMyVehicle->GetModelIndex() != MI_TOYZ) {
if (!attackerPed->m_pMyVehicle || attackerPed->m_pMyVehicle->GetModelIndex() != MI_TOPFUN) {
int16 lastVehicle;
CEntity *vehicles[8];
CWorld::FindObjectsInRange(GetPosition(), 30.0f, true, &lastVehicle, 6, vehicles, false, true, false, false, false);
@ -15670,7 +15670,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
} else {
if (veh->GetUp().z > -0.8f) {
bool addDoorSmoke = false;
if (veh->GetModelIndex() == MI_YARDIE)
if (veh->GetModelIndex() == MI_VOODOO)
addDoorSmoke = true;
switch (m_vehEnterType) {

View File

@ -748,7 +748,8 @@ CPopulation::AddPedInCar(CVehicle* car)
break;
case MI_TAXI:
case MI_CABBIE:
case MI_BORGNINE:
case MI_ZEBRA:
case MI_KAUFMAN:
if (CGeneral::GetRandomTrueFalse()) {
pedType = PEDTYPE_CIVMALE;
preferredModel = MI_TAXI_D;

View File

@ -1884,13 +1884,11 @@ WinMain(HINSTANCE instance,
StaticPatcher::Apply();
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
/*
// TODO: make this an option somewhere
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
*/
/*
* Initialize the platform independent data.

View File

@ -195,7 +195,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
CMatrix mat2(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_LF]));
mat1.GetPosition() += CVector(mat2.GetPosition().x + 0.1f, 0.0f, mat2.GetPosition().z);
mat1.UpdateRW();
}else if(GetModelIndex() == MI_MIAMI_SPARROW || GetModelIndex() == MI_MIAMI_RCRAIDER){
}else if(GetModelIndex() == MI_SPARROW || GetModelIndex() == MI_RCRAIDER){
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0);
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_RF]), 0);
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LB]), 0);
@ -490,8 +490,7 @@ CAutomobile::ProcessControl(void)
TankControl();
BlowUpCarsInPath();
break;
case MI_YARDIE:
// beta also had esperanto here it seems
case MI_VOODOO:
HydraulicControl();
break;
default:
@ -673,9 +672,9 @@ CAutomobile::ProcessControl(void)
acceleration /= m_fForceMultiplier;
// unused
if(GetModelIndex() == MI_MIAMI_RCBARON ||
GetModelIndex() == MI_MIAMI_RCRAIDER ||
GetModelIndex() == MI_MIAMI_SPARROW)
if(GetModelIndex() == MI_RCBARON ||
GetModelIndex() == MI_RCRAIDER ||
GetModelIndex() == MI_SPARROW)
acceleration = 0.0f;
brake = m_fBrakePedal * pHandling->fBrakeDeceleration * CTimer::GetTimeStep();
@ -1001,7 +1000,7 @@ CAutomobile::ProcessControl(void)
m_bSirenOrAlarm = !m_bSirenOrAlarm;
}else
m_nCarHornTimer = 0;
}else if(GetModelIndex() != MI_YARDIE && !CVehicle::bCheat3){
}else if(GetModelIndex() != MI_VOODOO && !CVehicle::bCheat3){
if(Pads[0].GetHorn())
m_nCarHornTimer = 1;
else
@ -1012,7 +1011,7 @@ CAutomobile::ProcessControl(void)
// Flying
if(GetStatus() != STATUS_PLAYER && GetStatus() != STATUS_PLAYER_REMOTE && GetStatus() != STATUS_PHYSICS){
if(GetModelIndex() == MI_MIAMI_RCRAIDER || GetModelIndex() == MI_MIAMI_SPARROW)
if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_SPARROW)
m_aWheelSpeed[0] = Max(m_aWheelSpeed[0]-0.0005f, 0.0f);
}else if((GetModelIndex() == MI_DODO || CVehicle::bAllDodosCheat) &&
m_vecMoveSpeed.Magnitude() > 0.0f && CTimer::GetTimeStep() > 0.0f){
@ -1022,9 +1021,9 @@ CAutomobile::ProcessControl(void)
else
#endif
FlyingControl(FLIGHT_MODEL_DODO);
}else if(GetModelIndex() == MI_MIAMI_RCBARON){
}else if(GetModelIndex() == MI_RCBARON){
FlyingControl(FLIGHT_MODEL_RCPLANE);
}else if(GetModelIndex() == MI_MIAMI_RCRAIDER || GetModelIndex() == MI_MIAMI_SPARROW || bAllCarCheat){
}else if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_SPARROW || bAllCarCheat){
#ifdef ALLCARSHELI_CHEAT
if (bAllCarCheat)
FlyingControl(FLIGHT_MODEL_HELI);
@ -1591,7 +1590,8 @@ CAutomobile::PreRender(void)
case MI_TAXI:
case MI_CABBIE:
case MI_BORGNINE:
case MI_ZEBRA:
case MI_KAUFMAN:
if(bTaxiLight){
CVector pos = GetPosition() + GetUp()*0.95f;
CCoronas::RegisterCorona((uintptr)this + 21,

View File

@ -287,8 +287,8 @@ CBoat::ProcessControl(void)
AddWakePoint(GetPosition());
float steerFactor = 1.0f - DotProduct(m_vecMoveSpeed, GetForward());
if (GetModelIndex() == MI_GHOST)
steerFactor = 1.0f - DotProduct(m_vecMoveSpeed, GetForward())*0.3f;
// if (GetModelIndex() == MI_GHOST)
// steerFactor = 1.0f - DotProduct(m_vecMoveSpeed, GetForward())*0.3f;
if(steerFactor < 0.0f) steerFactor = 0.0f;
CVector propeller(0.0f, -pHandling->Dimension.y*m_fPropellerY, -pHandling->Dimension.z*m_fPropellerZ);

View File

@ -21,7 +21,6 @@ const char VehicleNames[NUMHANDLINGS][14] = {
"STRETCH",
"MANANA",
"INFERNUS",
"BLISTA",
"PONY",
"MULE",
"CHEETAH",
@ -38,7 +37,6 @@ const char VehicleNames[NUMHANDLINGS][14] = {
"ENFORCER",
"SECURICA",
"BANSHEE",
"PREDATOR",
"BUS",
"RHINO",
"BARRACKS",
@ -50,22 +48,73 @@ const char VehicleNames[NUMHANDLINGS][14] = {
"STALLION",
"RUMPO",
"RCBANDIT",
"BELLYUP",
"MRWONGS",
"MAFIA",
"YARDIE",
"YAKUZA",
"DIABLOS",
"COLUMB",
"HOODS",
"AIRTRAIN",
"DEADDODO",
"SPEEDER",
"REEFER",
"PANLANT",
"FLATBED",
"YANKEE",
"BORGNINE"
"GOLFCART",
"VOODOO",
"WASHING",
"CUBAN",
"ROMERO",
"PACKER",
"ADMIRAL",
"GANGBUR",
"ZEBRA",
"TOPFUN",
"GLENDALE",
"OCEANIC",
"HERMES",
"SABRE1",
"SABRETUR",
"PHEONIX",
"WALTON",
"REGINA",
"COMET",
"DELUXO",
"BURRITO",
"SPAND",
"BAGGAGE",
"KAUFMAN",
"RANCHER",
"FBIRANCH",
"VIRGO",
"GREENWOO",
"HOTRING",
"SANDKING",
"BLISTAC",
"BOXVILLE",
"BENSON",
"DESPERAD",
"LOVEFIST",
"BLOODRA",
"BLOODRB",
"BIKE",
"MOPED",
"DIRTBIKE",
"ANGEL",
"FREEWAY",
"PREDATOR",
"SPEEDER",
"REEFER",
"RIO",
"SQUALO",
"TROPIC",
"COASTGRD",
"DINGHY",
"MARQUIS",
"CUPBOAT",
"SEAPLANE",
"SPARROW",
"SEASPAR",
"MAVERICK",
"COASTMAV",
"POLMAV",
"HUNTER",
"RCBARON",
"RCGOBLIN",
"RCCOPTER"
};
cHandlingDataMgr::cHandlingDataMgr(void)
@ -117,7 +166,9 @@ cHandlingDataMgr::LoadHandlingData(void)
// yeah, this is kinda crappy
if(strncmp(line, ";the end", 9) == 0)
keepGoing = 0;
else if(line[0] != ';'){
// else if(line[0] != ';'){
// TODO(MIAMI): read boat, bike, flying values
else if(line[0] != ';' && line[0] != '%' && line[0] != '!' && line[0] != '$'){
field = 0;
strcpy(delim, " \t");
// FIX: game seems to use a do-while loop here
@ -158,11 +209,14 @@ cHandlingDataMgr::LoadHandlingData(void)
case 27: handling->fSuspensionLowerLimit = strtod(word, nil); break;
case 28: handling->fSuspensionBias = strtod(word, nil); break;
case 29:
// TODO(MIAMI): suspension anti-dive multiplier
break;
case 30:
sscanf(word, "%x", &handling->Flags);
handling->Transmission.Flags = handling->Flags;
break;
case 30: handling->FrontLights = atoi(word); break;
case 31: handling->RearLights = atoi(word); break;
case 31: handling->FrontLights = atoi(word); break;
case 32: handling->RearLights = atoi(word); break;
}
field++;
}

View File

@ -139,5 +139,4 @@ public:
bool HasRearWheelDrive(eHandlingId id) { return HandlingData[id].Transmission.nDriveType == 'R'; }
bool HasFrontWheelDrive(eHandlingId id) { return HandlingData[id].Transmission.nDriveType == 'F'; }
};
VALIDATE_SIZE(cHandlingDataMgr, 0x3030);
extern cHandlingDataMgr mod_HandlingManager;

View File

@ -776,7 +776,6 @@ CHeli::InitHelis(void)
for(i = 0; i < NUM_HELIS; i++)
pHelis[i] = nil;
((CVehicleModelInfo*)CModelInfo::GetModelInfo(MI_ESCAPE))->SetColModel(&CTempColModels::ms_colModelPed1);
((CVehicleModelInfo*)CModelInfo::GetModelInfo(MI_CHOPPER))->SetColModel(&CTempColModels::ms_colModelPed1);
}
@ -787,10 +786,7 @@ GenerateHeli(bool catalina)
CVector heliPos;
int i;
if(catalina)
heli = new CHeli(MI_ESCAPE, PERMANENT_VEHICLE);
else
heli = new CHeli(MI_CHOPPER, PERMANENT_VEHICLE);
heli = new CHeli(MI_CHOPPER, PERMANENT_VEHICLE);
if(catalina)
heliPos = CVector(-224.0f, 201.0f, 83.0f);
@ -867,18 +863,6 @@ CHeli::UpdateHelis(void)
pHelis[HELI_SCRIPT]->m_heliStatus = HELI_STATUS_FLY_AWAY;
}
// Handle Catalina's heli
if(CatalinaHeliOn){
if(CStreaming::HasModelLoaded(MI_ESCAPE) && pHelis[HELI_CATALINA] == nil){
pHelis[HELI_CATALINA] = GenerateHeli(true);
pHelis[HELI_CATALINA]->m_heliType = HELI_TYPE_CATALINA;
}else
CStreaming::RequestModel(MI_ESCAPE, STREAMFLAGS_DONT_REMOVE);
}else{
if(pHelis[HELI_CATALINA])
pHelis[HELI_CATALINA]->m_heliStatus = HELI_STATUS_FLY_AWAY;
}
// Delete helis that we no longer need
for(i = 0; i < NUM_HELIS; i++)
if(pHelis[i] && pHelis[i]->m_heliStatus == HELI_STATUS_FLY_AWAY && pHelis[i]->GetPosition().z > 150.0f){

View File

@ -385,7 +385,7 @@ CVehicle::FlyingControl(eFlightModel flightModel)
case FLIGHT_MODEL_HELI:
{
CVector vecMoveResistance;
if (GetModelIndex() == MI_MIAMI_SPARROW)
if (GetModelIndex() == MI_SPARROW)
vecMoveResistance = vecHeliMoveRes;
else
vecMoveResistance = vecRCHeliMoveRes;
@ -436,7 +436,7 @@ CVehicle::FlyingControl(eFlightModel flightModel)
ApplyTurnForce(fYaw * GetForward() * fYawVar * m_fTurnMass * CTimer::GetTimeStep(), GetRight());
CVector vecResistance;
if (GetModelIndex() == MI_MIAMI_SPARROW)
if (GetModelIndex() == MI_SPARROW)
vecResistance = vecHeliResistance;
else
vecResistance = vecRCHeliResistance;
@ -875,24 +875,7 @@ CVehicle::IsVehicleNormal(void)
{
if (!pDriver || m_nNumPassengers != 0 || GetStatus() == STATUS_WRECKED)
return false;
switch (GetModelIndex()){
case MI_FIRETRUCK:
case MI_AMBULAN:
case MI_TAXI:
case MI_POLICE:
case MI_ENFORCER:
case MI_BUS:
case MI_RHINO:
case MI_BARRACKS:
case MI_DODO:
case MI_COACH:
case MI_CABBIE:
case MI_RCBANDIT:
case MI_BORGNINE:
return false;
default:
return true;
}
return GetModelInfo()->m_vehicleClass != -1;
}
bool
@ -1091,7 +1074,7 @@ CVehicle::SetDriver(CPed *driver)
driver->GiveWeapon(WEAPONTYPE_SHOTGUN, 5);
else if(GetModelIndex() == MI_ENFORCER)
driver->m_fArmour = Max(driver->m_fArmour, 100.0f);
else if(GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_BORGNINE)
else if(GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_ZEBRA) // TODO(MIAMI): check zebra
CWorld::Players[CWorld::PlayerInFocus].m_nMoney += 25;
bFreebies = false;
}

View File

@ -290,7 +290,7 @@ public:
bool IsAlarmOn(void) { return m_nAlarmState != 0 && m_nAlarmState != -1; }
CVehicleModelInfo* GetModelInfo() { return (CVehicleModelInfo*)CModelInfo::GetModelInfo(GetModelIndex()); }
bool IsTaxi(void) { return GetModelIndex() == MI_TAXI || GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_BORGNINE; }
bool IsTaxi(void) { return GetModelIndex() == MI_TAXI || GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_ZEBRA || GetModelIndex() == MI_KAUFMAN; }
AnimationId GetDriverAnim(void) { return IsCar() && bLowVehicle ? ANIM_CAR_LSIT : (IsBoat() && GetModelIndex() != MI_SPEEDER ? ANIM_DRIVE_BOAT : ANIM_CAR_SIT); }
static bool bWheelsOnlyCheat;