From f6f0cb708ec5dee32e14c7ecf04441757de01325 Mon Sep 17 00:00:00 2001 From: aap Date: Sat, 9 Jan 2021 16:13:38 +0100 Subject: boat fix --- src/vehicles/Boat.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index 695d380f..c8eb05f3 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -32,15 +32,15 @@ #define INVALID_ORIENTATION (-9999.99f) -float fShapeLength = 0.4f; -float fShapeTime = 0.05f; -float fRangeMult = 0.6f; -float fTimeMult; - float CBoat::MAX_WAKE_LENGTH = 50.0f; float CBoat::MIN_WAKE_INTERVAL = 2.0f; float CBoat::WAKE_LIFETIME = 150.0f; +float fShapeLength = 0.4f; +float fShapeTime = 0.05f; +float fRangeMult = 0.6f; +float fTimeMult = 1.0/CBoat::WAKE_LIFETIME; + CBoat *CBoat::apFrameWakeGeneratingBoats[4]; const uint32 CBoat::nSaveStructSize = -- cgit v1.2.3 From 434bc01f0b9f2b483fd996954bc37a26f28136bb Mon Sep 17 00:00:00 2001 From: aap Date: Sat, 9 Jan 2021 16:17:47 +0100 Subject: fix fix --- src/vehicles/Boat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index c8eb05f3..8dec0f89 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -39,7 +39,7 @@ float CBoat::WAKE_LIFETIME = 150.0f; float fShapeLength = 0.4f; float fShapeTime = 0.05f; float fRangeMult = 0.6f; -float fTimeMult = 1.0/CBoat::WAKE_LIFETIME; +float fTimeMult = 1.2f/CBoat::WAKE_LIFETIME; CBoat *CBoat::apFrameWakeGeneratingBoats[4]; -- cgit v1.2.3 From 203dff9165d473d030d8945ef80f1c12350662cf Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 9 Jan 2021 20:33:21 +0300 Subject: script --- src/animation/CutsceneMgr.cpp | 2 ++ src/control/Script.cpp | 6 +++--- src/control/Script3.cpp | 6 ++---- src/control/Script4.cpp | 15 ++++++++------- src/control/Script6.cpp | 4 ---- src/control/Script7.cpp | 21 +++++++++++++++++++-- src/control/Script8.cpp | 44 ++++++++++++++++++++++++++++++------------- src/core/Game.cpp | 2 +- src/text/Text.cpp | 2 +- src/vehicles/Bike.cpp | 2 +- 10 files changed, 68 insertions(+), 36 deletions(-) (limited to 'src/vehicles') diff --git a/src/animation/CutsceneMgr.cpp b/src/animation/CutsceneMgr.cpp index eeec2728..88c73661 100644 --- a/src/animation/CutsceneMgr.cpp +++ b/src/animation/CutsceneMgr.cpp @@ -431,6 +431,7 @@ CCutsceneMgr::DeleteCutsceneData(void) } ms_numCutsceneObjs = 0; + /* TODO!!! tmp hack for (int i = MI_SPECIAL01; i < MI_SPECIAL21; i++) { CBaseModelInfo *minfo = CModelInfo::GetModelInfo(i); CColModel *colModel = minfo->GetColModel(); @@ -439,6 +440,7 @@ CCutsceneMgr::DeleteCutsceneData(void) minfo->SetColModel(&CTempColModels::ms_colModelPed1); } } + */ if (ms_animLoaded) CAnimManager::RemoveLastAnimFile(); diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 5fbf5779..df851daa 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -2385,7 +2385,7 @@ int32* GetPointerToScriptVariableForDebug(CRunningScript* pScript, uint32* pIp, script_assert(size > 0); script_assert(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id] < size); uint8 index = Min(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id], size - 1); - sprintf(tmpstr, " $%d[%d@]", ((int)(type - ARGUMENT_GLOBAL_ARRAY) << 8) + index_in_block, index_id); + sprintf(tmpstr, " $%d[%d@ (%d)]", ((int)(type - ARGUMENT_GLOBAL_ARRAY) << 8) + index_in_block, index_id, pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id]); strcat(buf, tmpstr); return (int32*)&CTheScripts::ScriptSpace[4 * (((int)(type - ARGUMENT_GLOBAL_ARRAY) << 8) + index + index_in_block)]; } @@ -2401,7 +2401,7 @@ int32* GetPointerToScriptVariableForDebug(CRunningScript* pScript, uint32* pIp, script_assert(size > 0); script_assert(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id] < size); uint8 index = Min(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id], size - 1); - sprintf(tmpstr, " %d@[%d@]", (type - ARGUMENT_LOCAL_ARRAY), index_id); + sprintf(tmpstr, " %d@[%d@ (%d)]", (type - ARGUMENT_LOCAL_ARRAY), index_id, pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id]); strcat(buf, tmpstr); return &pScript->m_anLocalVariables[pScript->m_nLocalsPointer + (type - ARGUMENT_LOCAL_ARRAY) + index]; } @@ -2412,7 +2412,7 @@ int32* GetPointerToScriptVariableForDebug(CRunningScript* pScript, uint32* pIp, } else { assert(type >= ARGUMENT_TIMER); - sprintf(tmpstr, " TIMER%d@", (type - ARGUMENT_LOCAL_ARRAY)); + sprintf(tmpstr, " TIMER%d@", (type - ARGUMENT_TIMER)); strcat(buf, tmpstr); return &pScript->m_anLocalVariables[NUM_LOCAL_VARS + 8 + (type - ARGUMENT_TIMER)]; // why 8? } diff --git a/src/control/Script3.cpp b/src/control/Script3.cpp index 26e1187d..0134df00 100644 --- a/src/control/Script3.cpp +++ b/src/control/Script3.cpp @@ -1787,10 +1787,9 @@ int8 CRunningScript::ProcessCommands700To799(int32 command) pBoat->AutoPilot.m_nCruiseSpeed = *(float*)&ScriptParams[1]; return 0; } - /* case COMMAND_GET_RANDOM_CHAR_IN_AREA: { - CollectParameters(&m_nIp, 4); + CollectParameters(&m_nIp, 7); int ped_handle = -1; CVector pos = FindPlayerCoors(); float x1 = *(float*)&ScriptParams[0]; @@ -1814,7 +1813,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command) continue; // if (pPed->GetModelIndex() == MI_SCUM_WOM || pPed->GetModelIndex() == MI_SCUM_MAN) // continue; - if (!ThisIsAValidRandomPed(pPed->m_nPedType)) + if (!ThisIsAValidRandomPed(pPed->m_nPedType, ScriptParams[5], ScriptParams[6], ScriptParams[7])) // TODO continue; if (pPed->bIsLeader || pPed->m_leader) continue; @@ -1836,7 +1835,6 @@ int8 CRunningScript::ProcessCommands700To799(int32 command) StoreParameters(&m_nIp, 1); return 0; } - */ case COMMAND_GET_RANDOM_CHAR_IN_ZONE: { char zone[KEY_LENGTH_IN_SCRIPT]; diff --git a/src/control/Script4.cpp b/src/control/Script4.cpp index 64928e7a..a8cc9b9c 100644 --- a/src/control/Script4.cpp +++ b/src/control/Script4.cpp @@ -954,7 +954,10 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) pPed->WarpPedIntoCar(pVehicle); return 0; } - //case COMMAND_SWITCH_CAR_RADIO: + case COMMAND_SWITCH_CAR_RADIO: + CollectParameters(&m_nIp, 1); + DMAudio.ChangeMusicMode(ScriptParams[0]); + return 0; //case COMMAND_SET_AUDIO_STREAM: case COMMAND_PRINT_WITH_2_NUMBERS_BIG: { @@ -1418,7 +1421,6 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) pVehicle->m_bSirenOrAlarm = ScriptParams[1] != 0; return 0; } - /* case COMMAND_SWITCH_PED_ROADS_ON_ANGLED: { CollectParameters(&m_nIp, 7); @@ -1441,7 +1443,6 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) ThePaths.SwitchRoadsInAngledArea(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[2], *(float*)&ScriptParams[3], *(float*)&ScriptParams[4], *(float*)&ScriptParams[5], *(float*)&ScriptParams[6], 1, 0); return 0; - */ case COMMAND_SET_CAR_WATERTIGHT: { CollectParameters(&m_nIp, 2); @@ -1967,12 +1968,10 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) CWorld::Add(car); return 0; } - /* case COMMAND_IS_COLLISION_IN_MEMORY: CollectParameters(&m_nIp, 1); UpdateCompareFlag(CCollision::ms_collisionInMemory == ScriptParams[0]); return 0; - */ case COMMAND_SET_WANTED_MULTIPLIER: CollectParameters(&m_nIp, 1); FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = *(float*)&ScriptParams[0]; @@ -2042,7 +2041,8 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) case COMMAND_HAS_MISSION_AUDIO_LOADED: { CollectParameters(&m_nIp, 1); - UpdateCompareFlag(DMAudio.GetMissionAudioLoadingStatus(ScriptParams[0] - 1) == 1); + //UpdateCompareFlag(DMAudio.GetMissionAudioLoadingStatus(ScriptParams[0] - 1) == 1); + UpdateCompareFlag(true); // TODO return 0; } case COMMAND_PLAY_MISSION_AUDIO: @@ -2052,7 +2052,8 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) case COMMAND_HAS_MISSION_AUDIO_FINISHED: { CollectParameters(&m_nIp, 1); - UpdateCompareFlag(DMAudio.IsMissionAudioSampleFinished(ScriptParams[0] - 1)); + //UpdateCompareFlag(DMAudio.IsMissionAudioSampleFinished(ScriptParams[0] - 1)); // TODO + UpdateCompareFlag(true); return 0; } case COMMAND_GET_CLOSEST_CAR_NODE_WITH_HEADING: diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index 8915a089..02427eed 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -83,7 +83,6 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) { switch (command) { //case COMMAND_FLASH_RADAR_BLIP: - /* case COMMAND_IS_CHAR_IN_CONTROL: { CollectParameters(&m_nIp, 1); @@ -91,7 +90,6 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) UpdateCompareFlag(pPed->IsPedInControl()); return 0; } - */ case COMMAND_SET_GENERATE_CARS_AROUND_CAMERA: CollectParameters(&m_nIp, 1); CCarCtrl::bCarsGeneratedAroundCamera = (ScriptParams[0] != 0); @@ -525,7 +523,6 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) StoreParameters(&m_nIp, 1); return 0; } - /* case COMMAND_MARK_ROADS_BETWEEN_LEVELS: { CollectParameters(&m_nIp, 6); @@ -574,7 +571,6 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) ThePaths.PedMarkRoadsBetweenLevelsInArea(infX, supX, infY, supY, infZ, supZ); return 0; } - */ case COMMAND_SET_CAR_AVOID_LEVEL_TRANSITIONS: { CollectParameters(&m_nIp, 2); diff --git a/src/control/Script7.cpp b/src/control/Script7.cpp index 344ea2c7..220a7c4d 100644 --- a/src/control/Script7.cpp +++ b/src/control/Script7.cpp @@ -816,7 +816,12 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) //case COMMAND_HAS_CHAR_BEEN_DAMAGED_BY_CAR: //case COMMAND_HAS_CAR_BEEN_DAMAGED_BY_CHAR: //case COMMAND_HAS_CAR_BEEN_DAMAGED_BY_CAR: - //case COMMAND_GET_RADIO_CHANNEL: + case COMMAND_GET_RADIO_CHANNEL: + { + // TODO + ScriptParams[0] = -1; + StoreParameters(&m_nIp, 1); + } //case COMMAND_DISPLAY_TEXT_WITH_3_NUMBERS: //case COMMAND_IS_CAR_DROWNING_IN_WATER: case COMMAND_IS_CHAR_DROWNING_IN_WATER: @@ -1327,7 +1332,19 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) CollectParameters(&m_nIp, 1); UpdateCompareFlag(CPools::GetPedPool()->GetAt(ScriptParams[0]) != 0); return 0; - //case COMMAND_DOES_VEHICLE_EXIST: + case COMMAND_DOES_VEHICLE_EXIST: + { + // TODO + CollectParameters(&m_nIp, 1); + CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]); + bool bExist = false; + if (pVehicle) { + int index = CPools::GetVehiclePool()->GetJustIndex_NoFreeAssert(pVehicle); + bExist = (index >= 0 && index <= NUMVEHICLES); // TODO: FIX_BUGS + } + UpdateCompareFlag(bExist); + return 0; + } //case COMMAND_ADD_SHORT_RANGE_BLIP_FOR_CONTACT_POINT: case COMMAND_ADD_SHORT_RANGE_SPRITE_BLIP_FOR_CONTACT_POINT: { diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp index 63102d24..f41ef8a4 100644 --- a/src/control/Script8.cpp +++ b/src/control/Script8.cpp @@ -421,7 +421,10 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) script_assert(false); return 0; case COMMAND_1451: - script_assert(false); + CollectParameters(&m_nIp, 1); + // TODO (GET_PAD_BUTTON_STATE) + ScriptParams[0] = 0; + StoreParameters(&m_nIp, 1); return 0; case COMMAND_1452: script_assert(false); @@ -518,7 +521,8 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) script_assert(false); return 0; case COMMAND_1479: - script_assert(false); + CollectParameters(&m_nIp, 2); + // TODO (SET_CHAR_ONLY_ENTER_BACK_DOOR) return 0; case COMMAND_1480: script_assert(false); @@ -644,7 +648,8 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) script_assert(false); return 0; case COMMAND_1518: - script_assert(false); + // TODO (?) + UpdateCompareFlag(true); return 0; case COMMAND_1519: CollectParameters(&m_nIp, 1); @@ -768,7 +773,8 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) script_assert(false); return 0; case COMMAND_1558: - script_assert(false); + UpdateCompareFlag(false); + // TODO return 0; case COMMAND_1559: script_assert(false); @@ -778,7 +784,8 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) UpdateCompareFlag(false); return 0; case COMMAND_1561: - script_assert(false); + // TODO (check, SET_FS_DESTROYED_FLAG) + CTheScripts::FSDestroyedFlag = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL) - (int32*)CTheScripts::ScriptSpace; return 0; case COMMAND_1562: script_assert(false); @@ -796,7 +803,8 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) script_assert(false); return 0; case COMMAND_1567: - script_assert(false); + CollectParameters(&m_nIp, 1); + // TODO (BUILD_WORLD_GEOMETRY) return 0; case COMMAND_1568: script_assert(false); @@ -927,7 +935,8 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) script_assert(false); return 0; case COMMAND_1607: - script_assert(false); + CollectParameters(&m_nIp, 1); + // TODO (SET_TOTAL_CARS_FOR_EXPORT) return 0; case COMMAND_1608: script_assert(false); @@ -951,10 +960,11 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) script_assert(false); return 0; case COMMAND_1615: - script_assert(false); + // TODO (GET_DEVELOPER_FLAG?) + UpdateCompareFlag(false); return 0; case COMMAND_1616: - script_assert(false); + // TODO (SET_DEVELOPER_FLAG) return 0; case COMMAND_1617: script_assert(false); @@ -969,8 +979,12 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) script_assert(false); return 0; case COMMAND_1621: - script_assert(false); + { + wchar* key = CTheScripts::GetTextByKeyFromScript(&m_nIp); + CollectParameters(&m_nIp, 2); + // TODO (SET_SUBTITLE_TEXT) return 0; + } case COMMAND_1622: script_assert(false); return 0; @@ -1035,7 +1049,8 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) // TODO (LOCK_GARAGE?) return 0; case COMMAND_1641: - script_assert(false); + // TODO + UpdateCompareFlag(true); return 0; case COMMAND_1642: script_assert(false); @@ -1054,14 +1069,17 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) // TODO (DISABLE_PAUSE_MENU?) return 0; case COMMAND_1647: - script_assert(false); + CollectParameters(&m_nIp, 1); + // TODO (IS_CHANNEL_PLAYING?) + UpdateCompareFlag(false); return 0; case COMMAND_1648: CollectParameters(&m_nIp, 3); // TODO (SET_CLOCK_EVENT_WARNING); return 0; case COMMAND_1649: - script_assert(false); + CollectParameters(&m_nIp, 3); + // TODO (SET_EXTRA_COLOUR_DIRECTION) return 0; case COMMAND_1650: script_assert(false); diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 636eed42..c5154bd4 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -901,7 +901,7 @@ void CGame::Process(void) if (!CReplay::IsPlayingBack()) CCranes::UpdateCranes(); CClouds::Update(); - CMovingThings::Update(); + //CMovingThings::Update(); // TODO CWaterCannons::Update(); CUserDisplay::Process(); CReplay::Update(); diff --git a/src/text/Text.cpp b/src/text/Text.cpp index a11acd26..fd1659dc 100644 --- a/src/text/Text.cpp +++ b/src/text/Text.cpp @@ -247,7 +247,7 @@ CText::LoadMissionText(char *MissionTableName) CFileMgr::SetDir("TEXT"); switch (FrontEndMenuManager.m_PrefsLanguage) { case CMenuManager::LANGUAGE_AMERICAN: - sprintf(filename, "AMERICAN.GXT"); + sprintf(filename, "ENGLISH.GXT"); break; case CMenuManager::LANGUAGE_FRENCH: sprintf(filename, "FRENCH.GXT"); diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp index 19e95a6e..531128be 100644 --- a/src/vehicles/Bike.cpp +++ b/src/vehicles/Bike.cpp @@ -83,7 +83,7 @@ CBike::CBike(int32 id, uint8 CreatedBy) case MI_SANCHEZ: m_bikeAnimType = ASSOCGRP_BIKE_DIRT; break; - default: assert(0 && "invalid bike model ID"); + default: m_bikeAnimType = ASSOCGRP_BIKE_STANDARD; //assert(0 && "invalid bike model ID"); // TODO } m_vehType = VEHICLE_TYPE_BIKE; -- cgit v1.2.3 From c3b6e9da43c1e61a076056feb74aefbecbad39c6 Mon Sep 17 00:00:00 2001 From: shfil Date: Sun, 10 Jan 2021 17:14:33 +0100 Subject: Fix linux build --- src/vehicles/Cranes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Cranes.cpp b/src/vehicles/Cranes.cpp index ffcb80d0..ce254100 100644 --- a/src/vehicles/Cranes.cpp +++ b/src/vehicles/Cranes.cpp @@ -466,7 +466,7 @@ bool CCranes::DoesMilitaryCraneHaveThisOneAlready(uint32 mi) case MI_FIRETRUCK: return (CarsCollectedMilitaryCrane & 1); case MI_AMBULAN: return (CarsCollectedMilitaryCrane & 2); case MI_ENFORCER: return (CarsCollectedMilitaryCrane & 4); - case MI_FBIRANCH: return (CarsCollectedMilitaryCrane & 8); + case (uint32)MI_FBIRANCH: return (CarsCollectedMilitaryCrane & 8); case MI_RHINO: return (CarsCollectedMilitaryCrane & 0x10); case MI_BARRACKS: return (CarsCollectedMilitaryCrane & 0x20); case MI_POLICE: return (CarsCollectedMilitaryCrane & 0x40); @@ -481,7 +481,7 @@ void CCranes::RegisterCarForMilitaryCrane(uint32 mi) case MI_FIRETRUCK: CarsCollectedMilitaryCrane |= 1; break; case MI_AMBULAN: CarsCollectedMilitaryCrane |= 2; break; case MI_ENFORCER: CarsCollectedMilitaryCrane |= 4; break; - case MI_FBIRANCH: CarsCollectedMilitaryCrane |= 8; break; + case (uint32)MI_FBIRANCH: CarsCollectedMilitaryCrane |= 8; break; case MI_RHINO: CarsCollectedMilitaryCrane |= 0x10; break; case MI_BARRACKS: CarsCollectedMilitaryCrane |= 0x20; break; case MI_POLICE: CarsCollectedMilitaryCrane |= 0x40; break; -- cgit v1.2.3 From b5711b21dc6843b9146a9f1d12a99473a0873f35 Mon Sep 17 00:00:00 2001 From: erorcun Date: Mon, 11 Jan 2021 01:10:24 +0300 Subject: Automobile: fix --- src/vehicles/Automobile.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 16d29b26..3a0121ec 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -288,17 +288,17 @@ CAutomobile::ProcessControl(void) // Improve grip of vehicles in certain cases bool strongGrip1 = false; bool strongGrip2 = false; - if(FindPlayerVehicle() && this != FindPlayerVehicle() && + if(FindPlayerVehicle() && this != FindPlayerVehicle() && FindPlayerPed()->m_pWanted->m_nWantedLevel > 3 && (AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_RAMPLAYER_CLOSE || - AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_CLOSE)){ - if(FindPlayerSpeed().Magnitude() > 0.3f){ - strongGrip1 = true; - if(FindPlayerSpeed().Magnitude() > 0.4f && - m_vecMoveSpeed.Magnitude() < 0.3f) - strongGrip2 = true; - else if((GetPosition() - FindPlayerCoors()).Magnitude() > 50.0f) - strongGrip2 = true; - } + AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_CLOSE) && + FindPlayerSpeed().Magnitude() > 0.3f){ + + strongGrip1 = true; + if(FindPlayerSpeed().Magnitude() > 0.4f && + m_vecMoveSpeed.Magnitude() < 0.3f) + strongGrip2 = true; + else if((GetPosition() - FindPlayerCoors()).Magnitude() > 50.0f) + strongGrip2 = true; }else if(GetModelIndex() == MI_RCBANDIT && GetStatus() != STATUS_PLAYER_REMOTE) strongGrip1 = true; -- cgit v1.2.3 From 4a8a1af8858edeef949d8f2ecbd25d3c93ccd042 Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 11 Jan 2021 18:42:54 +0100 Subject: fix CPed struct, GetWantedLevel --- src/core/Wanted.h | 1 + src/peds/Ped.h | 7 ++++++- src/vehicles/Automobile.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/vehicles') diff --git a/src/core/Wanted.h b/src/core/Wanted.h index 057b5407..f2da23e3 100644 --- a/src/core/Wanted.h +++ b/src/core/Wanted.h @@ -41,6 +41,7 @@ public: int32 NumOfHelisRequired(); void SetWantedLevel(int32); void SetWantedLevelNoDrop(int32 level); + int32 GetWantedLevel() { return m_nWantedLevel; } void CheatWantedLevel(int32 level); void RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare); void RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare); diff --git a/src/peds/Ped.h b/src/peds/Ped.h index 6c0d9987..7798483f 100644 --- a/src/peds/Ped.h +++ b/src/peds/Ped.h @@ -492,10 +492,15 @@ public: uint32 bDonePositionOutOfCollision : 1; uint32 bCanAttackPlayerWithCops : 1; +#ifdef KANGAROO_CHEAT // our own flags uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle +#endif uint8 m_gangFlags; + uint8 m_unused15D; // these 3 can't be padding but had to actually have been members ... + uint8 m_unused15E; + uint8 m_unused15F; uint8 CharCreatedBy; eObjective m_objective; eObjective m_prevObjective; @@ -536,7 +541,7 @@ public: uint32 m_pathNodeTimer; CPathNode m_pathNodeObjPool[8]; CPathNode* m_pCurPathNode; - char m_nPathDir; + int8 m_nPathDir; CPathNode* m_pLastPathNode; CPathNode* m_pNextPathNode; CVector m_followPathDestPos; diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 3a0121ec..65e3f313 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -288,7 +288,7 @@ CAutomobile::ProcessControl(void) // Improve grip of vehicles in certain cases bool strongGrip1 = false; bool strongGrip2 = false; - if(FindPlayerVehicle() && this != FindPlayerVehicle() && FindPlayerPed()->m_pWanted->m_nWantedLevel > 3 && + if(FindPlayerVehicle() && this != FindPlayerVehicle() && FindPlayerPed()->m_pWanted->GetWantedLevel() > 3 && (AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_RAMPLAYER_CLOSE || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_CLOSE) && FindPlayerSpeed().Magnitude() > 0.3f){ -- cgit v1.2.3 From 0f0812618acd6d5c87bd218bfb6f0b099135e64e Mon Sep 17 00:00:00 2001 From: majestic Date: Mon, 11 Jan 2021 11:23:56 -0800 Subject: unused CFerryDoor --- src/vehicles/Door.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/vehicles/Door.h | 19 ++++++++++++++++++ 2 files changed, 74 insertions(+) (limited to 'src/vehicles') diff --git a/src/vehicles/Door.cpp b/src/vehicles/Door.cpp index c80965aa..72a30339 100644 --- a/src/vehicles/Door.cpp +++ b/src/vehicles/Door.cpp @@ -168,3 +168,58 @@ CTrainDoor::IsClosed(void) { return m_fPosn == RetTranslationWhenClosed(); } + +bool +CFerryDoor::IsInUse(void) +{ + float translationDifference = m_fPrevPosn - m_fPosn; + m_fPrevPosn = m_fPosn; + return Abs(translationDifference) > 0.002f; +} + +float +CFerryDoor::RetTranslationWhenClosed(void) +{ + if(Abs(m_fClosedPosn) < Abs(m_fOpenPosn)) + return m_fClosedPosn; + else + return m_fOpenPosn; +} + +bool +CFerryDoor::IsClosed(void) +{ + return m_fPosn == RetTranslationWhenClosed(); +} + +float +CFerryDoor::RetTranslationWhenOpen(void) +{ + if(Abs(m_fClosedPosn) < Abs(m_fOpenPosn)) + return m_fOpenPosn; + else + return m_fClosedPosn; +} + +bool +CFerryDoor::IsFullyOpen(void) +{ + if(Abs(m_fPosn) < Abs(RetTranslationWhenOpen()) - 0.5f) + return false; + return true; +} + +void +CFerryDoor::Open(float ratio) +{ + float open; + + m_fPrevPosn = m_fPosn; + open = RetTranslationWhenOpen(); + if(ratio < 1.0f){ + m_fPosn = open*ratio; + }else{ + m_nDoorState = DOORST_OPEN; + m_fPosn = open; + } +} \ No newline at end of file diff --git a/src/vehicles/Door.h b/src/vehicles/Door.h index 567d3263..da5a3de0 100644 --- a/src/vehicles/Door.h +++ b/src/vehicles/Door.h @@ -67,3 +67,22 @@ public: float RetTranslationWhenOpen(void); void Open(float ratio); }; + + +class CFerryDoor { +private: + float m_fClosedPosn; + float m_fOpenPosn; + int8 m_nDirn; + int8 m_nAxis; + int8 m_nDoorState; + float m_fPosn; + float m_fPrevPosn; +public: + bool IsInUse(void); + float RetTranslationWhenClosed(void); + float RetTranslationWhenOpen(void); + bool IsClosed(void); + bool IsFullyOpen(void); + void Open(float ratio); +}; \ No newline at end of file -- cgit v1.2.3