diff options
author | aap <aap@papnet.eu> | 2020-05-07 11:33:20 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-07 11:33:20 +0200 |
commit | 05a1d64fbbe374dabb6572bb47d9a745464633bb (patch) | |
tree | e56b03fbb2c768324a4b540645eac2dc8c5bdf08 /src/control | |
parent | changed default ID ranges. old default.ide incompatible now (diff) | |
download | re3-05a1d64fbbe374dabb6572bb47d9a745464633bb.tar re3-05a1d64fbbe374dabb6572bb47d9a745464633bb.tar.gz re3-05a1d64fbbe374dabb6572bb47d9a745464633bb.tar.bz2 re3-05a1d64fbbe374dabb6572bb47d9a745464633bb.tar.lz re3-05a1d64fbbe374dabb6572bb47d9a745464633bb.tar.xz re3-05a1d64fbbe374dabb6572bb47d9a745464633bb.tar.zst re3-05a1d64fbbe374dabb6572bb47d9a745464633bb.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/CarCtrl.cpp | 34 | ||||
-rw-r--r-- | src/control/CarCtrl.h | 11 | ||||
-rw-r--r-- | src/control/Garages.cpp | 11 | ||||
-rw-r--r-- | src/control/Replay.cpp | 3 | ||||
-rw-r--r-- | src/control/Script.cpp | 39 |
5 files changed, 57 insertions, 41 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index a4769d56..702bd411 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -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: { diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h index 4f92bdcf..89de0418 100644 --- a/src/control/CarCtrl.h +++ b/src/control/CarCtrl.h @@ -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); diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 249b91ef..1b670dbe 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -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++) { diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 707f1d87..92cadab7 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -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)){ diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 0c3806a3..58222317 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -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: |