small fixes

This commit is contained in:
aap 2020-05-19 21:42:55 +02:00
parent 0d0f4da27a
commit 0b0ba49abc
6 changed files with 173 additions and 187 deletions

View File

@ -1823,7 +1823,7 @@ void
CWorld::RepositionOneObject(CEntity *pEntity) CWorld::RepositionOneObject(CEntity *pEntity)
{ {
int16 modelId = pEntity->GetModelIndex(); int16 modelId = pEntity->GetModelIndex();
if (IsTrafficLight(modelId) || IsTreeModel(modelId) || modelId == MI_PARKINGMETER || if (IsStreetLight(modelId) || IsTreeModel(modelId) || modelId == MI_PARKINGMETER ||
modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN || modelId == MI_BIN || modelId == MI_POSTBOX1 || modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN || modelId == MI_BIN || modelId == MI_POSTBOX1 ||
modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE || modelId == MI_DUMP1 || modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE || modelId == MI_DUMP1 ||
modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 || modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 ||

View File

@ -683,7 +683,7 @@ CEntity::ProcessLightsForEntity(void)
lightOn = true; lightOn = true;
break; break;
case LIGHT_FLICKER_NIGHT: case LIGHT_FLICKER_NIGHT:
if(CClock::GetHours() > 18 || CClock::GetHours() < 7){ if(CClock::GetHours() > 18 || CClock::GetHours() < 7 || CWeather::WetRoads > 0.5f){){
if((CTimer::GetTimeInMilliseconds() ^ m_randomSeed) & 0x60) if((CTimer::GetTimeInMilliseconds() ^ m_randomSeed) & 0x60)
lightOn = true; lightOn = true;
else else

View File

@ -1076,13 +1076,13 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists)
if(B->IsBuilding()) if(B->IsBuilding())
skipShift = false; skipShift = false;
else if(IsTrafficLight(A->GetModelIndex()) && else if(IsStreetLight(A->GetModelIndex()) &&
(B->IsVehicle() || B->IsPed()) && (B->IsVehicle() || B->IsPed()) &&
A->GetUp().z < 0.66f) A->GetUp().z < 0.66f)
skipShift = true; skipShift = true;
else if((A->IsVehicle() || A->IsPed()) && else if((A->IsVehicle() || A->IsPed()) &&
B->GetUp().z < 0.66f && B->GetUp().z < 0.66f &&
IsTrafficLight(B->GetModelIndex())) IsStreetLight(B->GetModelIndex()))
skipShift = true; skipShift = true;
// TODO: maybe flip some ifs here // TODO: maybe flip some ifs here
else if(A->IsObject() && B->IsVehicle()){ else if(A->IsObject() && B->IsVehicle()){
@ -1407,7 +1407,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
if(B->IsBuilding()) if(B->IsBuilding())
skipCollision = false; skipCollision = false;
else if(IsTrafficLight(A->GetModelIndex()) && else if(IsStreetLight(A->GetModelIndex()) &&
(B->IsVehicle() || B->IsPed()) && (B->IsVehicle() || B->IsPed()) &&
A->GetUp().z < 0.66f){ A->GetUp().z < 0.66f){
skipCollision = true; skipCollision = true;
@ -1415,7 +1415,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
Aobj->m_pCollidingEntity = B; Aobj->m_pCollidingEntity = B;
}else if((A->IsVehicle() || A->IsPed()) && }else if((A->IsVehicle() || A->IsPed()) &&
B->GetUp().z < 0.66f && B->GetUp().z < 0.66f &&
IsTrafficLight(B->GetModelIndex())){ IsStreetLight(B->GetModelIndex())){
skipCollision = true; skipCollision = true;
A->bSkipLineCol = true; A->bSkipLineCol = true;
Bobj->m_pCollidingEntity = A; Bobj->m_pCollidingEntity = A;

View File

@ -3,14 +3,14 @@
#include "General.h" #include "General.h"
#include "ModelIndices.h" #include "ModelIndices.h"
#define X(name, var, addr) int16 var; #define X(name, var) int16 var;
MODELINDICES MODELINDICES
#undef X #undef X
void void
InitModelIndices(void) InitModelIndices(void)
{ {
#define X(name, var, addr) var = -1; #define X(name, var) var = -1;
MODELINDICES MODELINDICES
#undef X #undef X
} }
@ -18,7 +18,7 @@ InitModelIndices(void)
void void
MatchModelString(const char *modelname, int16 id) MatchModelString(const char *modelname, int16 id)
{ {
#define X(name, var, addr) \ #define X(name, var) \
if(!CGeneral::faststrcmp(name, modelname)){ \ if(!CGeneral::faststrcmp(name, modelname)){ \
var = id; \ var = id; \
return; \ return; \

View File

@ -1,164 +1,164 @@
#pragma once #pragma once
#define MODELINDICES \ #define MODELINDICES \
X("fire_hydrant", MI_FIRE_HYDRANT, 0x5F5A00) \ X("fire_hydrant", MI_FIRE_HYDRANT) \
X("bagelstnd02", MI_BAGELSTAND2, 0x5F59FC) \ X("bagelstnd02", MI_BAGELSTAND2) \
X("fish01", MI_FISHSTALL01, 0x5F59EC) \ X("fish01", MI_FISHSTALL01) \
X("fishstall02", MI_FISHSTALL02, 0x5F59F0) \ X("fishstall02", MI_FISHSTALL02) \
X("fishstall03", MI_FISHSTALL03, 0x5F59F4) \ X("fishstall03", MI_FISHSTALL03) \
X("fishstall04", MI_FISHSTALL04, 0x5F59F8) \ X("fishstall04", MI_FISHSTALL04) \
X("taxisign", MI_TAXISIGN, 0x5F59E8) \ X("taxisign", MI_TAXISIGN) \
X("phonesign", MI_PHONESIGN, 0x5F59E4) \ X("phonesign", MI_PHONESIGN) \
X("noparkingsign1", MI_NOPARKINGSIGN1, 0x5F59E0) \ X("noparkingsign1", MI_NOPARKINGSIGN1) \
X("bussign1", MI_BUSSIGN1, 0x5F59DC) \ X("bussign1", MI_BUSSIGN1) \
X("roadworkbarrier1", MI_ROADWORKBARRIER1, 0x5F59D8) \ X("roadworkbarrier1", MI_ROADWORKBARRIER1) \
X("dump1", MI_DUMP1, 0x5F59D4) \ X("dump1", MI_DUMP1) \
X("trafficcone", MI_TRAFFICCONE, 0x5F59D0) \ X("trafficcone", MI_TRAFFICCONE) \
X("newsstand1", MI_NEWSSTAND, 0x5F59CC) \ X("newsstand1", MI_NEWSSTAND) \
X("postbox1", MI_POSTBOX1, 0x5F59C8) \ X("postbox1", MI_POSTBOX1) \
X("bin1", MI_BIN, 0x5F59C4) \ X("bin1", MI_BIN) \
X("wastebin", MI_WASTEBIN, 0x5F59C0) \ X("wastebin", MI_WASTEBIN) \
X("phonebooth1", MI_PHONEBOOTH1, 0x5F59BC) \ X("phonebooth1", MI_PHONEBOOTH1) \
X("parkingmeter", MI_PARKINGMETER, 0x5F59B8) \ X("parkingmeter", MI_PARKINGMETER) \
X("trafficlight1", MI_TRAFFICLIGHTS, 0x5F5958) \ X("trafficlight1", MI_TRAFFICLIGHTS) \
X("lamppost1", MI_SINGLESTREETLIGHTS1, 0x5F595C) \ X("lamppost1", MI_SINGLESTREETLIGHTS1) \
X("lamppost2", MI_SINGLESTREETLIGHTS2, 0x5F5960) \ X("lamppost2", MI_SINGLESTREETLIGHTS2) \
X("lamppost3", MI_SINGLESTREETLIGHTS3, 0x5F5964) \ X("lamppost3", MI_SINGLESTREETLIGHTS3) \
X("doublestreetlght1", MI_DOUBLESTREETLIGHTS, 0x5F5968) \ X("doublestreetlght1", MI_DOUBLESTREETLIGHTS) \
X("rd_Road2A10", MI_ROADSFORROADBLOCKSSTART, 0x5F596C) \ X("rd_Road2A10", MI_ROADSFORROADBLOCKSSTART) \
X("rd_Road1A30", MI_ROADSFORROADBLOCKSEND, 0x5F5970) \ X("rd_Road1A30", MI_ROADSFORROADBLOCKSEND) \
X("veg_tree1", MI_TREE1, 0x5F5974) \ X("veg_tree1", MI_TREE1) \
X("veg_tree3", MI_TREE2, 0x5F5978) \ X("veg_tree3", MI_TREE2) \
X("veg_treea1", MI_TREE3, 0x5F597C) \ X("veg_treea1", MI_TREE3) \
X("veg_treenew01", MI_TREE4, 0x5F5980) \ X("veg_treenew01", MI_TREE4) \
X("veg_treenew05", MI_TREE5, 0x5F5984) \ X("veg_treenew05", MI_TREE5) \
X("veg_treeb1", MI_TREE6, 0x5F5988) \ X("veg_treeb1", MI_TREE6) \
X("veg_treenew10", MI_TREE7, 0x5F598C) \ X("veg_treenew10", MI_TREE7) \
X("veg_treea3", MI_TREE8, 0x5F5990) \ X("veg_treea3", MI_TREE8) \
X("veg_treenew09", MI_TREE9, 0x5F5994) \ X("veg_treenew09", MI_TREE9) \
X("veg_treenew08", MI_TREE10, 0x5F5998) \ X("veg_treenew08", MI_TREE10) \
X("veg_treenew03", MI_TREE11, 0x5F599C) \ X("veg_treenew03", MI_TREE11) \
X("veg_treenew16", MI_TREE12, 0x5F59A0) \ X("veg_treenew16", MI_TREE12) \
X("veg_treenew17", MI_TREE13, 0x5F59A4) \ X("veg_treenew17", MI_TREE13) \
X("veg_treenew06", MI_TREE14, 0x5F59A8) \ X("veg_treenew06", MI_TREE14) \
X("doc_crane_cab", MODELID_CRANE_1, 0x5F59AC) \ X("doc_crane_cab", MODELID_CRANE_1) \
X("cranetopb", MODELID_CRANE_2, 0x5F59B0) \ X("cranetopb", MODELID_CRANE_2) \
X("cranetopa", MODELID_CRANE_3, 0x5F59B4) \ X("cranetopa", MODELID_CRANE_3) \
X("package1", MI_COLLECTABLE1, 0x5F5A04) \ X("package1", MI_COLLECTABLE1) \
X("Money", MI_MONEY, 0x5F5A08) \ X("Money", MI_MONEY) \
X("barrel1", MI_CARMINE, 0x5F5A0C) \ X("barrel1", MI_CARMINE) \
X("oddjgaragdoor", MI_GARAGEDOOR1, 0x5F5A10) \ X("oddjgaragdoor", MI_GARAGEDOOR1) \
X("bombdoor", MI_GARAGEDOOR2, 0x5F5A14) \ X("bombdoor", MI_GARAGEDOOR2) \
X("door_bombshop", MI_GARAGEDOOR3, 0x5F5A18) \ X("door_bombshop", MI_GARAGEDOOR3) \
X("vheistlocdoor", MI_GARAGEDOOR4, 0x5F5A1C) \ X("vheistlocdoor", MI_GARAGEDOOR4) \
X("door2_garage", MI_GARAGEDOOR5, 0x5F5A20) \ X("door2_garage", MI_GARAGEDOOR5) \
X("ind_slidedoor", MI_GARAGEDOOR6, 0x5F5A24) \ X("ind_slidedoor", MI_GARAGEDOOR6) \
X("bankjobdoor", MI_GARAGEDOOR7, 0x5F5A28) \ X("bankjobdoor", MI_GARAGEDOOR7) \
X("door_jmsgrage", MI_GARAGEDOOR9, 0x5F5A2C) \ X("door_jmsgrage", MI_GARAGEDOOR9) \
X("jamesgrge_kb", MI_GARAGEDOOR10, 0x5F5A30) \ X("jamesgrge_kb", MI_GARAGEDOOR10) \
X("door_sfehousegrge", MI_GARAGEDOOR11, 0x5F5A34) \ X("door_sfehousegrge", MI_GARAGEDOOR11) \
X("shedgaragedoor", MI_GARAGEDOOR12, 0x5F5A38) \ X("shedgaragedoor", MI_GARAGEDOOR12) \
X("door4_garage", MI_GARAGEDOOR13, 0x5F5A3C) \ X("door4_garage", MI_GARAGEDOOR13) \
X("door_col_compnd_01", MI_GARAGEDOOR14, 0x5F5A40) \ X("door_col_compnd_01", MI_GARAGEDOOR14) \
X("door_col_compnd_02", MI_GARAGEDOOR15, 0x5F5A44) \ X("door_col_compnd_02", MI_GARAGEDOOR15) \
X("door_col_compnd_03", MI_GARAGEDOOR16, 0x5F5A48) \ X("door_col_compnd_03", MI_GARAGEDOOR16) \
X("door_col_compnd_04", MI_GARAGEDOOR17, 0x5F5A4C) \ X("door_col_compnd_04", MI_GARAGEDOOR17) \
X("door_col_compnd_05", MI_GARAGEDOOR18, 0x5F5A50) \ X("door_col_compnd_05", MI_GARAGEDOOR18) \
X("impex_door", MI_GARAGEDOOR19, 0x5F5A54) \ X("impex_door", MI_GARAGEDOOR19) \
X("SalvGarage", MI_GARAGEDOOR20, 0x5F5A58) \ X("SalvGarage", MI_GARAGEDOOR20) \
X("door3_garage", MI_GARAGEDOOR21, 0x5F5A5C) \ X("door3_garage", MI_GARAGEDOOR21) \
X("leveldoor2", MI_GARAGEDOOR22, 0x5F5A60) \ X("leveldoor2", MI_GARAGEDOOR22) \
X("double_garage_dr", MI_GARAGEDOOR23, 0x5F5A64) \ X("double_garage_dr", MI_GARAGEDOOR23) \
X("amcogaragedoor", MI_GARAGEDOOR24, 0x5F5A68) \ X("amcogaragedoor", MI_GARAGEDOOR24) \
X("towergaragedoor1", MI_GARAGEDOOR25, 0x5F5A6C) \ X("towergaragedoor1", MI_GARAGEDOOR25) \
X("towergaragedoor2", MI_GARAGEDOOR26, 0x5F5A70) \ X("towergaragedoor2", MI_GARAGEDOOR26) \
X("towergaragedoor3", MI_GARAGEDOOR27, 0x5F5A74) \ X("towergaragedoor3", MI_GARAGEDOOR27) \
X("plysve_gragedoor", MI_GARAGEDOOR28, 0x5F5A78) \ X("plysve_gragedoor", MI_GARAGEDOOR28) \
X("impexpsubgrgdoor", MI_GARAGEDOOR29, 0x5F5A7C) \ X("impexpsubgrgdoor", MI_GARAGEDOOR29) \
X("Sub_sprayshopdoor", MI_GARAGEDOOR30, 0x5F5A80) \ X("Sub_sprayshopdoor", MI_GARAGEDOOR30) \
X("ind_plyrwoor", MI_GARAGEDOOR31, 0x5F5A84) \ X("ind_plyrwoor", MI_GARAGEDOOR31) \
X("8ballsuburbandoor", MI_GARAGEDOOR32, 0x5F5A88) \ X("8ballsuburbandoor", MI_GARAGEDOOR32) \
X("barrel2", MI_NAUTICALMINE, 0x5F5A8C) \ X("barrel2", MI_NAUTICALMINE) \
X("crushercrush", MI_CRUSHERBODY, 0x5F5A90) \ X("crushercrush", MI_CRUSHERBODY) \
X("crushertop", MI_CRUSHERLID, 0x5F5A94) \ X("crushertop", MI_CRUSHERLID) \
X("donkeymag", MI_DONKEYMAG, 0x5F5A98) \ X("donkeymag", MI_DONKEYMAG) \
X("bullion", MI_BULLION, 0x5F5A9C) \ X("bullion", MI_BULLION) \
X("floatpackge1", MI_FLOATPACKAGE1, 0x5F5AA0) \ X("floatpackge1", MI_FLOATPACKAGE1) \
X("briefcase", MI_BRIEFCASE, 0x5F5AA4) \ X("briefcase", MI_BRIEFCASE) \
X("chinabanner1", MI_CHINABANNER1, 0x5F5AA8) \ X("chinabanner1", MI_CHINABANNER1) \
X("chinabanner2", MI_CHINABANNER2, 0x5F5AAC) \ X("chinabanner2", MI_CHINABANNER2) \
X("chinabanner3", MI_CHINABANNER3, 0x5F5AB0) \ X("chinabanner3", MI_CHINABANNER3) \
X("chinabanner4", MI_CHINABANNER4, 0x5F5AB4) \ X("chinabanner4", MI_CHINABANNER4) \
X("iten_chinatown5", MI_CHINABANNER5, 0x5F5AB8) \ X("iten_chinatown5", MI_CHINABANNER5) \
X("iten_chinatown7", MI_CHINABANNER6, 0x5F5ABC) \ X("iten_chinatown7", MI_CHINABANNER6) \
X("iten_chinatown3", MI_CHINABANNER7, 0x5F5AC0) \ X("iten_chinatown3", MI_CHINABANNER7) \
X("iten_chinatown2", MI_CHINABANNER8, 0x5F5AC4) \ X("iten_chinatown2", MI_CHINABANNER8) \
X("iten_chinatown4", MI_CHINABANNER9, 0x5F5AC8) \ X("iten_chinatown4", MI_CHINABANNER9) \
X("iten_washline01", MI_CHINABANNER10, 0x5F5ACC) \ X("iten_washline01", MI_CHINABANNER10) \
X("iten_washline02", MI_CHINABANNER11, 0x5F5AD0) \ X("iten_washline02", MI_CHINABANNER11) \
X("iten_washline03", MI_CHINABANNER12, 0x5F5AD4) \ X("iten_washline03", MI_CHINABANNER12) \
X("chinalanterns", MI_CHINALANTERN, 0x5F5AD8) \ X("chinalanterns", MI_CHINALANTERN) \
X("glassfx1", MI_GLASS1, 0x5F5ADC) \ X("glassfx1", MI_GLASS1) \
X("glassfx2", MI_GLASS2, 0x5F5AE0) \ X("glassfx2", MI_GLASS2) \
X("glassfx3", MI_GLASS3, 0x5F5AE4) \ X("glassfx3", MI_GLASS3) \
X("glassfx4", MI_GLASS4, 0x5F5AE8) \ X("glassfx4", MI_GLASS4) \
X("glassfx55", MI_GLASS5, 0x5F5AEC) \ X("glassfx55", MI_GLASS5) \
X("glassfxsub1", MI_GLASS6, 0x5F5AF0) \ X("glassfxsub1", MI_GLASS6) \
X("glassfxsub2", MI_GLASS7, 0x5F5AF4) \ X("glassfxsub2", MI_GLASS7) \
X("glassfx_composh", MI_GLASS8, 0x5F5AF8) \ X("glassfx_composh", MI_GLASS8) \
X("bridge_liftsec", MI_BRIDGELIFT, 0x5F5AFC) \ X("bridge_liftsec", MI_BRIDGELIFT) \
X("bridge_liftweight", MI_BRIDGEWEIGHT, 0x5F5B00) \ X("bridge_liftweight", MI_BRIDGEWEIGHT) \
X("subbridge_lift", MI_BRIDGEROADSEGMENT, 0x5F5B04) \ X("subbridge_lift", MI_BRIDGEROADSEGMENT) \
X("barrel4", MI_EXPLODINGBARREL, 0x5F5B08) \ X("barrel4", MI_EXPLODINGBARREL) \
X("flagsitaly", MI_ITALYBANNER1, 0x5F5B0C) \ X("flagsitaly", MI_ITALYBANNER1) \
X("adrenaline", MI_PICKUP_ADRENALINE, 0x5F5B10) \ X("adrenaline", MI_PICKUP_ADRENALINE) \
X("bodyarmour", MI_PICKUP_BODYARMOUR, 0x5F5B14) \ X("bodyarmour", MI_PICKUP_BODYARMOUR) \
X("info", MI_PICKUP_INFO, 0x5F5B18) \ X("info", MI_PICKUP_INFO) \
X("health", MI_PICKUP_HEALTH, 0x5F5B1C) \ X("health", MI_PICKUP_HEALTH) \
X("bonus", MI_PICKUP_BONUS, 0x5F5B20) \ X("bonus", MI_PICKUP_BONUS) \
X("bribe", MI_PICKUP_BRIBE, 0x5F5B24) \ X("bribe", MI_PICKUP_BRIBE) \
X("killfrenzy", MI_PICKUP_KILLFRENZY, 0x5F5B28) \ X("killfrenzy", MI_PICKUP_KILLFRENZY) \
X("camerapickup", MI_PICKUP_CAMERA, 0x5F5B2C) \ X("camerapickup", MI_PICKUP_CAMERA) \
X("bollardlight", MI_BOLLARDLIGHT, 0x5F5B30) \ X("bollardlight", MI_BOLLARDLIGHT) \
X("magnet", MI_MAGNET, 0x5F5B34) \ X("magnet", MI_MAGNET) \
X("streetlamp1", MI_STREETLAMP1, 0x5F5B38) \ X("streetlamp1", MI_STREETLAMP1) \
X("streetlamp2", MI_STREETLAMP2, 0x5F5B3C) \ X("streetlamp2", MI_STREETLAMP2) \
X("railtrax_lo4b", MI_RAILTRACKS, 0x5F5B40) \ X("railtrax_lo4b", MI_RAILTRACKS) \
X("bar_barrier10", MI_FENCE, 0x5F5B44) \ X("bar_barrier10", MI_FENCE) \
X("bar_barrier12", MI_FENCE2, 0x5F5B48) \ X("bar_barrier12", MI_FENCE2) \
X("petrolpump", MI_PETROLPUMP, 0x5F5B4C) \ X("petrolpump", MI_PETROLPUMP) \
X("bodycast", MI_BODYCAST, 0x5F5B50) \ X("bodycast", MI_BODYCAST) \
X("backdoor", MI_BACKDOOR, 0x5F5B54) \ X("backdoor", MI_BACKDOOR) \
X("coffee", MI_COFFEE, 0x5F5B58) \ X("coffee", MI_COFFEE) \
X("bouy", MI_BUOY, 0x5F5B5C) \ X("bouy", MI_BUOY) \
X("parktable1", MI_PARKTABLE, 0x5F5B60) \ X("parktable1", MI_PARKTABLE) \
X("sbwy_tunl_start", MI_SUBWAY1, 0x5F5B64) \ X("sbwy_tunl_start", MI_SUBWAY1) \
X("sbwy_tunl_bit", MI_SUBWAY2, 0x5F5B68) \ X("sbwy_tunl_bit", MI_SUBWAY2) \
X("sbwy_tunl_bend", MI_SUBWAY3, 0x5F5B6C) \ X("sbwy_tunl_bend", MI_SUBWAY3) \
X("sbwy_tunl_cstm6", MI_SUBWAY4, 0x5F5B70) \ X("sbwy_tunl_cstm6", MI_SUBWAY4) \
X("sbwy_tunl_cstm7", MI_SUBWAY5, 0x5F5B74) \ X("sbwy_tunl_cstm7", MI_SUBWAY5) \
X("sbwy_tunl_cstm8", MI_SUBWAY6, 0x5F5B78) \ X("sbwy_tunl_cstm8", MI_SUBWAY6) \
X("sbwy_tunl_cstm10", MI_SUBWAY7, 0x5F5B7C) \ X("sbwy_tunl_cstm10", MI_SUBWAY7) \
X("sbwy_tunl_cstm9", MI_SUBWAY8, 0x5F5B80) \ X("sbwy_tunl_cstm9", MI_SUBWAY8) \
X("sbwy_tunl_cstm11", MI_SUBWAY9, 0x5F5B84) \ X("sbwy_tunl_cstm11", MI_SUBWAY9) \
X("sbwy_tunl_cstm1", MI_SUBWAY10, 0x5F5B88) \ X("sbwy_tunl_cstm1", MI_SUBWAY10) \
X("sbwy_tunl_cstm2", MI_SUBWAY11, 0x5F5B8C) \ X("sbwy_tunl_cstm2", MI_SUBWAY11) \
X("sbwy_tunl_cstm4", MI_SUBWAY12, 0x5F5B90) \ X("sbwy_tunl_cstm4", MI_SUBWAY12) \
X("sbwy_tunl_cstm3", MI_SUBWAY13, 0x5F5B94) \ X("sbwy_tunl_cstm3", MI_SUBWAY13) \
X("sbwy_tunl_cstm5", MI_SUBWAY14, 0x5F5B98) \ X("sbwy_tunl_cstm5", MI_SUBWAY14) \
X("subplatform_n2", MI_SUBWAY15, 0x5F5B9C) \ X("subplatform_n2", MI_SUBWAY15) \
X("suby_tunl_start", MI_SUBWAY16, 0x5F5BA0) \ X("suby_tunl_start", MI_SUBWAY16) \
X("sbwy_tunl_start2", MI_SUBWAY17, 0x5F5BA4) \ X("sbwy_tunl_start2", MI_SUBWAY17) \
X("indy_tunl_start", MI_SUBWAY18, 0x5F5BA8) \ X("indy_tunl_start", MI_SUBWAY18) \
X("indsubway03", MI_SUBPLATFORM_IND, 0x5F5BAC) \ X("indsubway03", MI_SUBPLATFORM_IND) \
X("comerside_subway", MI_SUBPLATFORM_COMS, 0x5F5BB0) \ X("comerside_subway", MI_SUBPLATFORM_COMS) \
X("subplatform", MI_SUBPLATFORM_COMS2, 0x5F5BB4) \ X("subplatform", MI_SUBPLATFORM_COMS2) \
X("subplatform_n", MI_SUBPLATFORM_COMN, 0x5F5BB8) \ X("subplatform_n", MI_SUBPLATFORM_COMN) \
X("Otherside_subway", MI_SUBPLATFORM_SUB, 0x5F5BBC) \ X("Otherside_subway", MI_SUBPLATFORM_SUB) \
X("subplatform_sub", MI_SUBPLATFORM_SUB2, 0x5F5BC0) \ X("subplatform_sub", MI_SUBPLATFORM_SUB2) \
X("files", MI_FILES, 0x5F5BC4) X("files", MI_FILES)
#define X(name, var, addr) extern int16 var; #define X(name, var) extern int16 var;
MODELINDICES MODELINDICES
#undef X #undef X
@ -255,7 +255,9 @@ enum
MI_BUSKER4, MI_BUSKER4,
// three more peds possible // three more peds possible
MI_FIRST_VEHICLE = 90, MI_LAST_PED = 89,
MI_FIRST_VEHICLE,
MI_LANDSTAL = MI_FIRST_VEHICLE, MI_LANDSTAL = MI_FIRST_VEHICLE,
MI_IDAHO, MI_IDAHO,
MI_STINGER, MI_STINGER,
@ -382,7 +384,7 @@ IsGlass(int16 id)
} }
inline bool inline bool
IsTrafficLight(int16 id) IsStreetLight(int16 id)
{ {
return id == MI_TRAFFICLIGHTS || return id == MI_TRAFFICLIGHTS ||
id == MI_SINGLESTREETLIGHTS1 || id == MI_SINGLESTREETLIGHTS1 ||
@ -410,7 +412,7 @@ IsBoatModel(int16 id)
inline bool inline bool
IsPedModel(int16 id) IsPedModel(int16 id)
{ {
return id >= 0 && id <= 89; return id >= MI_PLAYER && id <= MI_LAST_PED;
} }
inline bool inline bool

View File

@ -966,18 +966,11 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy)
if (!obj) if (!obj)
return; return;
bool makeInvisible;
CWorld::Remove(dummy); CWorld::Remove(dummy);
delete dummy; delete dummy;
CWorld::Add(obj); CWorld::Add(obj);
int16 mi = obj->GetModelIndex();
if (mi == MI_GLASS1 || mi == MI_GLASS2 || mi == MI_GLASS3 || mi == MI_GLASS4 ||
mi == MI_GLASS5 || mi == MI_GLASS6 || mi == MI_GLASS7 || mi == MI_GLASS8)
makeInvisible = true;
else
makeInvisible = false;
if (makeInvisible) { if (IsGlass(obj->GetModelIndex())) {
obj->bIsVisible = false; obj->bIsVisible = false;
} else if (obj->GetModelIndex() == MI_BUOY) { } else if (obj->GetModelIndex() == MI_BUOY) {
obj->bIsStatic = false; obj->bIsStatic = false;
@ -996,17 +989,8 @@ CPopulation::ConvertToDummyObject(CObject *obj)
dummy->GetMatrix().UpdateRW(); dummy->GetMatrix().UpdateRW();
dummy->UpdateRwFrame(); dummy->UpdateRwFrame();
bool makeInvisible; if (IsGlass(obj->GetModelIndex()))
int16 mi = obj->GetModelIndex();
if (mi == MI_GLASS1 || mi == MI_GLASS2 || mi == MI_GLASS3 || mi == MI_GLASS4 ||
mi == MI_GLASS5 || mi == MI_GLASS6 || mi == MI_GLASS7 || mi == MI_GLASS8)
makeInvisible = true;
else
makeInvisible = false;
if (makeInvisible) {
dummy->bIsVisible = false; dummy->bIsVisible = false;
}
CWorld::Remove(obj); CWorld::Remove(obj);
delete obj; delete obj;