From b54bb62c944f8f3e8d85501fbb762915fdc6569b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Thu, 13 Aug 2020 23:39:55 +0300 Subject: Stats(except displaying), PlayerInfo, marker fix --- src/core/Pad.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/core/Pad.cpp') diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index c1016bdd..6d6c30e4 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -41,6 +41,7 @@ #include "Fluff.h" #include "Gangs.h" #include "platform.h" +#include "Stats.h" #ifdef GTA_PS2 #include "eetypes.h" @@ -59,6 +60,7 @@ bool CPad::bDisplayNoControllerMessage; bool CPad::bObsoleteControllerMessage; bool CPad::bOldDisplayNoControllerMessage; bool CPad::m_bMapPadOneToPadTwo; +bool CPad::bHasPlayerCheated; #ifdef GTA_PS2 unsigned char act_direct[6]; unsigned char act_align[6]; @@ -228,6 +230,8 @@ void VehicleCheat(bool something, int model) CWorld::Add(vehicle); } } + CStats::CheatedCount += 1000; + CPad::bHasPlayerCheated = true; } void BlowUpCarsCheat() @@ -287,6 +291,8 @@ void MayhemCheat() PED_FLAG_GANG2 | PED_FLAG_GANG3 | PED_FLAG_GANG4 | PED_FLAG_GANG5 | PED_FLAG_GANG6 | PED_FLAG_GANG7 | PED_FLAG_GANG8 | PED_FLAG_GANG9 | PED_FLAG_EMERGENCY | PED_FLAG_PROSTITUTE | PED_FLAG_CRIMINAL | PED_FLAG_SPECIAL ); + CStats::CheatedCount += 1000; + CPad::bHasPlayerCheated = true; } void EverybodyAttacksPlayerCheat() @@ -294,12 +300,17 @@ void EverybodyAttacksPlayerCheat() CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); for (int i = PEDTYPE_CIVMALE; i < PEDTYPE_SPECIAL; i++) CPedType::AddThreat(i, PED_FLAG_PLAYER1); + + CStats::CheatedCount += 1000; + CPad::bHasPlayerCheated = true; } void WeaponsForAllCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CPopulation::ms_bGivePedsWeapons = !CPopulation::ms_bGivePedsWeapons; + CStats::CheatedCount += 1000; + CPad::bHasPlayerCheated = true; } void FastTimeCheat() @@ -380,19 +391,24 @@ void OnlyRenderWheelsCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CVehicle::bWheelsOnlyCheat = !CVehicle::bWheelsOnlyCheat; + CStats::CheatedCount += 1000; + CPad::bHasPlayerCheated = true; } - void ChittyChittyBangBangCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CVehicle::bAllDodosCheat = !CVehicle::bAllDodosCheat; + CStats::CheatedCount += 1000; + CPad::bHasPlayerCheated = true; } void StrongGripCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CVehicle::bCheat3 = !CVehicle::bCheat3; + CStats::CheatedCount += 1000; + CPad::bHasPlayerCheated = true; } void NastyLimbsCheat() @@ -404,6 +420,7 @@ void FannyMagnetCheat() { CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CPed::bFannyMagnetCheat = !CPed::bFannyMagnetCheat; + CPad::bHasPlayerCheated = true; } void BlackCarsCheat() @@ -437,6 +454,7 @@ void BackToTheFuture(void) { CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CVehicle::bHoverCheat = !CVehicle::bHoverCheat; + CPad::bHasPlayerCheated = true; } void SuicideCheat(void) { @@ -453,6 +471,8 @@ void DoChicksWithGunsCheat(void) { CStreaming::RemoveCurrentZonesModels(); CGangs::SetGangPedModels(GANG_PLAYER, MI_HFYBE, MI_WFYBE); CGangs::SetGangWeapons(GANG_PLAYER, WEAPONTYPE_M4, WEAPONTYPE_M4); + CStats::CheatedCount += 1000; + CPad::bHasPlayerCheated = true; } ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 980dd1b5a17440e9a272b7b47ad3553cd1ce11ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sun, 16 Aug 2020 17:10:59 +0300 Subject: 2 new opcodes --- src/core/Pad.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/core/Pad.cpp') diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 6d6c30e4..222fe349 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -631,6 +631,11 @@ void CPad::Clear(bool bResetPlayerControls) ShakeFreq = 0; ShakeDur = 0; + for (int32 i = 0; i < DRUNK_STEERING_BUFFER_SIZE; i++) + SteeringLeftRightBuffer[i] = 0; + + DrunkDrivingBufferUsed = 0; + if ( bResetPlayerControls ) DisablePlayerControls = PLAYERCONTROL_ENABLED; @@ -1806,6 +1811,9 @@ void CPad::Update(int16 pad) bHornHistory[iCurrHornHistory] = GetHorn(); + for (int32 i = DRUNK_STEERING_BUFFER_SIZE - 2; i >= 0; i--) { + SteeringLeftRightBuffer[i + 1] = SteeringLeftRightBuffer[i]; + } if ( !bDisplayNoControllerMessage ) CGame::bDemoMode = false; @@ -1899,6 +1907,7 @@ int16 CPad::GetSteeringLeftRight(void) if ( ArePlayerControlsDisabled() ) return 0; + int16 value; switch (CURMODE) { case 0: @@ -1908,9 +1917,12 @@ int16 CPad::GetSteeringLeftRight(void) int16 dpad = (NewState.DPadRight - NewState.DPadLeft) / 2; if ( Abs(axis) > Abs(dpad) ) - return axis; + value = axis; else - return dpad; + value = dpad; + + SteeringLeftRightBuffer[0] = value; + value = SteeringLeftRightBuffer[DrunkDrivingBufferUsed]; break; } @@ -1918,13 +1930,18 @@ int16 CPad::GetSteeringLeftRight(void) case 1: case 3: { - return NewState.LeftStickX; - + SteeringLeftRightBuffer[0] = NewState.LeftStickX; + value = SteeringLeftRightBuffer[DrunkDrivingBufferUsed]; + break; + } + default: + { + value = 0; break; } } - return 0; + return value; } int16 CPad::GetSteeringUpDown(void) -- cgit v1.2.3 From d303c33c2e03edc4c4980a06afe81004f1ae430f Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 16 Aug 2020 18:39:11 +0300 Subject: CarCtrl finished, minor Script things --- src/core/Pad.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/core/Pad.cpp') diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 6d6c30e4..2c5c4c02 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -42,6 +42,7 @@ #include "Gangs.h" #include "platform.h" #include "Stats.h" +#include "CarCtrl.h" #ifdef GTA_PS2 #include "eetypes.h" @@ -437,6 +438,12 @@ void PinkCarsCheat() gbPinkCars = true; } +void MadCarsCheat() +{ + CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); + CCarCtrl::bMadDriversCheat = true; +} + void NoSeaBedCheat(void) { CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); @@ -1223,6 +1230,7 @@ void CPad::AddToPCCheatString(char c) // "MIAMITRAFFIC" else if (!Cheat_strncmp(KeyBoardCheatString, "FNMGNmWPNLVU")) { KeyBoardCheatString[0] = ' '; + MadCarsCheat(); } // "AHAIRDRESSERSCAR" else if (!Cheat_strncmp(KeyBoardCheatString, "UFJT_`VZF]QZPaUG")) { @@ -3087,7 +3095,7 @@ void CPad::ResetCheats(void) CVehicle::bCheat8 = false; gbBlackCars = false; gbPinkCars = false; - + CCarCtrl::bMadDriversCheat = false; gbFastTime = false; CTimer::SetTimeScale(1.0f); } -- cgit v1.2.3 From 4d1cfb7214a4867487f128c7e3360681f47e0239 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Wed, 19 Aug 2020 03:31:42 +0300 Subject: Island loading cleanup and fix --- src/core/Pad.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/Pad.cpp') diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index d4ffc5ea..3b46a110 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -11,7 +11,11 @@ #include "platform.h" #ifdef XINPUT #include +#if !defined(PSAPI_VERSION) || (PSAPI_VERSION > 1) #pragma comment( lib, "Xinput9_1_0.lib" ) +#else +#pragma comment( lib, "Xinput.lib" ) +#endif #endif #include "Pad.h" -- cgit v1.2.3