diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-05-03 00:12:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-03 00:12:54 +0300 |
commit | 7fc33d85f7730c4dc42fbbbd842a95135cda7508 (patch) | |
tree | a6fa86e0be48f39285693c2795053bd997f58dbe /src/control | |
parent | 9d600802fa0673e8c834c623bd65adc1893c8bf1 (diff) | |
parent | d2712afc788e59973b5331eb8d10870239d803e4 (diff) |
Merge pull request #504 from Sergeanur/PadInputSwitch
Switching pad modes and cheats when player is switching between controller and kb&m
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/Garages.cpp | 9 | ||||
-rw-r--r-- | src/control/Script.cpp | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 75d5d3ba..b6786598 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -528,9 +528,14 @@ void CGarage::Update() CGarages::GivePlayerDetonator(); CStats::KgsOfExplosivesUsed += KGS_OF_EXPLOSIVES_IN_BOMB; } +#ifdef DETECT_PAD_INPUT_SWITCH + int16 Mode = CPad::IsAffectedByController ? CPad::GetPad(0)->Mode : 0; +#else + int16 Mode = CPad::GetPad(0)->Mode; +#endif switch (m_eGarageType) { case GARAGE_BOMBSHOP1: - switch (CPad::GetPad(0)->Mode) { + switch (Mode) { case 0: case 1: case 2: @@ -542,7 +547,7 @@ void CGarage::Update() } break; case GARAGE_BOMBSHOP2: - switch (CPad::GetPad(0)->Mode) { + switch (Mode) { case 0: case 1: case 2: diff --git a/src/control/Script.cpp b/src/control/Script.cpp index b63a5d87..dbae1f21 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -5250,7 +5250,11 @@ int8 CRunningScript::ProcessCommands600To699(int32 command) return 0; } case COMMAND_GET_CONTROLLER_MODE: +#if defined(GTA_PC) && !defined(DETECT_PAD_INPUT_SWITCH) ScriptParams[0] = 0; +#else + ScriptParams[0] = CPad::IsAffectedByController ? CPad::GetPad(0)->Mode : 0; +#endif StoreParameters(&m_nIp, 1); return 0; case COMMAND_SET_CAN_RESPRAY_CAR: |