summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2022-12-26 06:37:40 -0500
committerGitHub <noreply@github.com>2022-12-26 06:37:40 -0500
commitf42f86e3ef4636e224eee474654eeda86c8d3a2b (patch)
tree6b7b82e646250fac672ec78a3dd7754a3b7366e1
parent85bccab1bb38e0fb497fc60e5e3db3aa35bc7b8e (diff)
fix: make fisherman rumble text work (#2279)
we weren't correctly setting the pakType in padMgr because the depreciated `gRumbleEnabled` cvar was being checked
-rw-r--r--soh/soh/OTRGlobals.cpp11
-rw-r--r--soh/soh/OTRGlobals.h2
-rw-r--r--soh/src/code/padmgr.c2
3 files changed, 8 insertions, 7 deletions
diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp
index a0fe66a2e..d63aee918 100644
--- a/soh/soh/OTRGlobals.cpp
+++ b/soh/soh/OTRGlobals.cpp
@@ -1757,12 +1757,13 @@ extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) {
}
}
-extern "C" int Controller_ShouldRumble(size_t i) {
+extern "C" int Controller_ShouldRumble(size_t slot) {
auto controlDeck = Ship::Window::GetInstance()->GetControlDeck();
-
- for (int i = 0; i < controlDeck->GetNumVirtualDevices(); ++i) {
- auto physicalDevice = controlDeck->GetPhysicalDeviceFromVirtualSlot(i);
- if (physicalDevice->CanRumble()) {
+
+ if (slot < controlDeck->GetNumVirtualDevices()) {
+ auto physicalDevice = controlDeck->GetPhysicalDeviceFromVirtualSlot(slot);
+
+ if (physicalDevice->getProfile(slot)->UseRumble && physicalDevice->CanRumble()) {
return 1;
}
}
diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h
index 51744dfb4..e8f068429 100644
--- a/soh/soh/OTRGlobals.h
+++ b/soh/soh/OTRGlobals.h
@@ -104,7 +104,7 @@ int AudioPlayer_Buffered(void);
int AudioPlayer_GetDesiredBuffered(void);
void AudioPlayer_Play(const uint8_t* buf, uint32_t len);
void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples);
-int Controller_ShouldRumble(size_t i);
+int Controller_ShouldRumble(size_t slot);
void Controller_BlockGameInput();
void Controller_UnblockGameInput();
void Hooks_ExecuteAudioInit();
diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c
index ed18dcbac..48752fed1 100644
--- a/soh/src/code/padmgr.c
+++ b/soh/src/code/padmgr.c
@@ -331,7 +331,7 @@ void PadMgr_HandleRetraceMsg(PadMgr* padMgr) {
osContGetReadData(padMgr->pads);
for (i = 0; i < __osMaxControllers; i++) {
- padMgr->padStatus[i].status = CVar_GetS32("gRumbleEnabled", 0) && Controller_ShouldRumble(i);
+ padMgr->padStatus[i].status = Controller_ShouldRumble(i);
}
if (padMgr->preNMIShutdown) {