From 75a20216d9c0c0cb4d0f9a8e56c2319214a1cb79 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 31 Jan 2021 01:38:43 +0300 Subject: [PATCH] sync --- src/control/Garages.h | 55 ++++++++++++++++++++++++++++-------- src/control/Script.cpp | 2 +- src/control/Script10.cpp | 7 +++-- src/control/Script3.cpp | 4 +++ src/control/ScriptCommands.h | 2 +- src/modelinfo/ModelIndices.h | 2 +- src/vehicles/Bike.cpp | 2 ++ src/vehicles/Bike.h | 1 + src/vehicles/Vehicle.cpp | 1 + src/vehicles/Vehicle.h | 6 ++-- 10 files changed, 62 insertions(+), 20 deletions(-) diff --git a/src/control/Garages.h b/src/control/Garages.h index c3542d27..eb2c3e18 100644 --- a/src/control/Garages.h +++ b/src/control/Garages.h @@ -15,6 +15,7 @@ enum eGarageState GS_OPENEDCONTAINSCAR, GS_CLOSEDCONTAINSCAR, GS_AFTERDROPOFF, + GS_WAITINGFORCAR }; enum eGarageType @@ -31,7 +32,7 @@ enum eGarageType GARAGE_COLLECTCARS_2, GARAGE_COLLECTCARS_3, GARAGE_FORCARTOCOMEOUTOF, - GARAGE_60SECONDS, + GARAGE_CRATE_GARAGE, GARAGE_CRUSHER, GARAGE_MISSION_KEEPCAR, GARAGE_FOR_SCRIPT_TO_OPEN, @@ -58,19 +59,34 @@ enum { TOTAL_COLLECTCARS_GARAGES = 4, TOTAL_HIDEOUT_GARAGES = 12, - TOTAL_COLLECTCARS_CARS = 6 + TOTAL_COLLECTCARS_CARS = 16 }; class CStoredCar { + enum { + FLAG_BULLETPROOF = 0x1, + FLAG_FIREPROOF = 0x2, + FLAG_EXPLOSIONPROOF = 0x4, + FLAG_COLLISIONPROOF = 0x8, + FLAG_MELEEPROOF = 0x10, + FLAG_TIRES_INVULNERABLE = 0x20, + FLAG_STRONG = 0x40, + FLAG_HEAVY = 0x80, + FLAG_PERMANENT_COLOUR = 0x100, + FLAG_BOMB = 0x200, + FLAG_NOT_DAMAGED_UPSIDEDOWN = 0x400, + FLAG_REWARD_VEHICLE = 0x8000 + }; int32 m_nModelIndex; - CVector m_vecPos; - CVector m_vecAngle; - int32 m_bBulletproof : 1; - int32 m_bFireproof : 1; - int32 m_bExplosionproof : 1; - int32 m_bCollisionproof : 1; - int32 m_bMeleeproof : 1; + float m_fPosX; + float m_fPosY; + float m_fPosZ; + float m_fForwardX; + float m_fForwardY; + float m_fForwardZ; + float m_fTractionMultiplier; + int32 m_nFlags; int8 m_nPrimaryColor; int8 m_nSecondaryColor; int8 m_nRadioStation; @@ -81,7 +97,6 @@ public: void Init() { m_nModelIndex = 0; } void Clear() { m_nModelIndex = 0; } bool HasCar() { return m_nModelIndex != 0; } - const CStoredCar &operator=(const CStoredCar& other); void StoreCar(CVehicle*); CVehicle* RestoreCar(); }; @@ -121,6 +136,8 @@ public: float m_fSupX; float m_fInfY; float m_fSupY; + uint32 m_nTimeCrusherCraneActivated; + CVehicle* m_pSSTargetCar; float m_fDoorPos; float m_fDoorHeight; float m_fDoor1X; @@ -133,6 +150,19 @@ public: uint8 m_bCollectedCarsState; CVehicle *m_pTarget; CStoredCar m_sStoredCar; // not needed +#ifdef GTA_NETWORK + void* m_pSSVehicle; // some multiplayer vehicle structure, +104 == GetVehiclePointer + bool m_bSSGarageAcceptedVehicle; +#endif + bool m_bInitialized; +#ifdef GTA_NETWORK + uint8 m_nSSGarageState; + bool m_bSSGarageStateChanging; +#endif + uint32 field_F0; + bool m_bLocked; + uint32 field_F8; + uint32 field_FC; void OpenThisGarage(); void CloseThisGarage(); @@ -219,6 +249,7 @@ public: static CGarage aGarages[NUM_GARAGES]; static CStoredCar aCarsInSafeHouses[TOTAL_HIDEOUT_GARAGES][NUM_GARAGE_STORED_CARS]; static bool bCamShouldBeOutisde; + static uint8 CrusherRewardMultiplier; static void Init(void); #ifndef PS2 @@ -297,6 +328,8 @@ public: } static bool IsThisGarageTypeSafehouse(uint8 type) { return FindSafeHouseIndexForGarageType(type) >= 0; } - static void SetupAnyGaragesForThisIsland(void) {} // TODO(LCS) + static bool InitDoorGubbins(uint32, uint8); + static void SetupAnyGaragesForThisIsland(void); + static void LockGarage(int16, bool); }; diff --git a/src/control/Script.cpp b/src/control/Script.cpp index d12bbb40..8ce2d84d 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -1808,7 +1808,7 @@ const tScriptCommandData commands[] = { REGISTER_COMMAND(COMMAND_PRINT_HELP_FOREVER_NO_BRIEF, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_PRINT_HELP_ALWAYS_NO_BRIEF, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_PRINT_HELP_FOREVER_ALWAYS_NO_BRIEF, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""), - REGISTER_COMMAND(COMMAND_SET_MISSION_CAR_CAN_BE_STORED_IN_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), + REGISTER_COMMAND(COMMAND_SET_CAR_IS_REWARD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_FREEZE_ALL_PLAYER_FOLLOWERS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), }; #undef REGISTER_COMMAND diff --git a/src/control/Script10.cpp b/src/control/Script10.cpp index 6514ebe5..ac3961a7 100644 --- a/src/control/Script10.cpp +++ b/src/control/Script10.cpp @@ -7,6 +7,7 @@ #include "DMAudio.h" #include "Frontend.h" #include "GameLogic.h" +#include "Garages.h" #include "General.h" #include "Hud.h" #include "Messages.h" @@ -286,7 +287,7 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) return 0; case COMMAND_LOCK_GARAGE: CollectParameters(&m_nIp, 2); - // CGarages::LockGarage(GET_INTEGER_PARAM(0), GET_INTEGER_PARAM(1)); + CGarages::LockGarage(GET_INTEGER_PARAM(0), GET_INTEGER_PARAM(1)); return 0; case COMMAND_IS_FINAL_GAME: #ifdef FINAL @@ -391,12 +392,12 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) CHud::SetHelpMessage(text, false, true); // + false return 0; } - case COMMAND_SET_MISSION_CAR_CAN_BE_STORED_IN_GARAGE: + case COMMAND_SET_CAR_IS_REWARD: { CollectParameters(&m_nIp, 2); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(0)); script_assert(pVehicle); - pVehicle->bAllowGarageToStore = (GET_INTEGER_PARAM(1) != 0); + pVehicle->bRewardVehicle = (GET_INTEGER_PARAM(1) != 0); return 0; } case COMMAND_FREEZE_ALL_PLAYER_FOLLOWERS: diff --git a/src/control/Script3.cpp b/src/control/Script3.cpp index f05c21eb..64014ac8 100644 --- a/src/control/Script3.cpp +++ b/src/control/Script3.cpp @@ -1225,6 +1225,10 @@ int8 CRunningScript::ProcessCommands600To699(int32 command) if (pVehicle->m_vehType == VEHICLE_TYPE_CAR) #endif ((CAutomobile*)pVehicle)->bFixedColour = (GET_INTEGER_PARAM(1) == 0); +#ifdef FIX_BUGS + else if (pVehicle->m_vehType == VEHICLE_TYPE_BIKE) + ((CBike*)pVehicle)->bFixedColour = (GET_INTEGER_PARAM(1) == 0); +#endif return 0; } diff --git a/src/control/ScriptCommands.h b/src/control/ScriptCommands.h index 76bc4aa3..000f561c 100644 --- a/src/control/ScriptCommands.h +++ b/src/control/ScriptCommands.h @@ -1656,7 +1656,7 @@ enum { COMMAND_PRINT_HELP_FOREVER_NO_BRIEF, COMMAND_PRINT_HELP_ALWAYS_NO_BRIEF, COMMAND_PRINT_HELP_FOREVER_ALWAYS_NO_BRIEF, - COMMAND_SET_MISSION_CAR_CAN_BE_STORED_IN_GARAGE, + COMMAND_SET_CAR_IS_REWARD, COMMAND_FREEZE_ALL_PLAYER_FOLLOWERS, #ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT LAST_SCRIPT_COMMAND diff --git a/src/modelinfo/ModelIndices.h b/src/modelinfo/ModelIndices.h index cbc4ede8..3a6b8252 100644 --- a/src/modelinfo/ModelIndices.h +++ b/src/modelinfo/ModelIndices.h @@ -647,7 +647,7 @@ extern CModelIndices *gpModelIndices; X("ind_slidedoor", MI_GARAGEDOOR6) \ X("bankjobdoor", MI_GARAGEDOOR7) \ X("door_jmsgrage", MI_GARAGEDOOR9) \ - X("jamesgrge_kb", MI_GARAGEDOOR10) \ + X("ind_safeh_gdoor", MI_GARAGEDOOR10) \ X("door_sfehousegrge", MI_GARAGEDOOR11) \ X("shedgaragedoor", MI_GARAGEDOOR12) \ X("door4_garage", MI_GARAGEDOOR13) \ diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp index 6ad59769..f8ef4746 100644 --- a/src/vehicles/Bike.cpp +++ b/src/vehicles/Bike.cpp @@ -134,6 +134,8 @@ CBike::CBike(int32 id, uint8 CreatedBy) bIsOnFire = false; bWheelieCam = false; + bFixedColour = false; // <- figure out actual place (TODO) + m_fTireTemperature = 1.0f; m_fBrakeDestabilization = 0.0f; m_fVelocityChangeForAudio = 0; diff --git a/src/vehicles/Bike.h b/src/vehicles/Bike.h index 219d8872..611cd11d 100644 --- a/src/vehicles/Bike.h +++ b/src/vehicles/Bike.h @@ -75,6 +75,7 @@ public: uint8 bExtraSpeed : 1; // leaning forward uint8 bIsOnFire : 1; uint8 bWheelieCam : 1; + uint8 bFixedColour : 1; // <- figure out its actual place (TODO) int16 m_doingBurnout; float m_fTireTemperature; float m_fBrakeDestabilization; diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index a3d07d5c..67acf47d 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -133,6 +133,7 @@ CVehicle::CVehicle(uint8 CreatedBy) bCreatedAsPoliceVehicle = false; bRestingOnPhysical = false; bParking = false; + m_bGarageTurnedLightsOff = false; bCanPark = CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 0.0f; // never true. probably doesn't work very well bIsVan = false; bIsBus = false; diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index cebafd77..450f1c3b 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -240,17 +240,17 @@ public: uint8 bRestingOnPhysical : 1; // Dont go static cause car is sitting on a physical object that might get removed uint8 bParking : 1; uint8 bCanPark : 1; -#if (!defined GTA_PS2 || defined FIX_BUGS) +#if (!defined GTA_PS2 || defined FIX_BUGS) // <- I think this can be moved back to CAutomobile? uint8 m_bombType : 3; #endif uint8 bDriverLastFrame : 1; - - uint8 bAllowGarageToStore : 1; // <- many LCS flags before + uint8 bRewardVehicle : 1; // 25B_40 int8 m_numPedsUseItAsCover; uint8 m_nAmmoInClip; // Used to make the guns on boat do a reload (20 by default) int8 m_nPacManPickupsCarried; uint8 m_nRoadblockType; + bool m_bGarageTurnedLightsOff; float m_fHealth; // 1000.0f = full health. 250.0f = fire. 0 -> explode float m_fEngineEnergy; // TODO(LCS): better name. it adds up acceleration force, so possibly kinetic energy?? uint8 m_nCurrentGear;