fix: make fisherman rumble text work (#2279)

we weren't correctly setting the pakType in padMgr because
the depreciated `gRumbleEnabled` cvar was being checked
This commit is contained in:
briaguya 2022-12-26 06:37:40 -05:00 committed by GitHub
parent 85bccab1bb
commit f42f86e3ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -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(); auto controlDeck = Ship::Window::GetInstance()->GetControlDeck();
for (int i = 0; i < controlDeck->GetNumVirtualDevices(); ++i) { if (slot < controlDeck->GetNumVirtualDevices()) {
auto physicalDevice = controlDeck->GetPhysicalDeviceFromVirtualSlot(i); auto physicalDevice = controlDeck->GetPhysicalDeviceFromVirtualSlot(slot);
if (physicalDevice->CanRumble()) {
if (physicalDevice->getProfile(slot)->UseRumble && physicalDevice->CanRumble()) {
return 1; return 1;
} }
} }

View File

@ -104,7 +104,7 @@ int AudioPlayer_Buffered(void);
int AudioPlayer_GetDesiredBuffered(void); int AudioPlayer_GetDesiredBuffered(void);
void AudioPlayer_Play(const uint8_t* buf, uint32_t len); void AudioPlayer_Play(const uint8_t* buf, uint32_t len);
void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples); 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_BlockGameInput();
void Controller_UnblockGameInput(); void Controller_UnblockGameInput();
void Hooks_ExecuteAudioInit(); void Hooks_ExecuteAudioInit();

View File

@ -331,7 +331,7 @@ void PadMgr_HandleRetraceMsg(PadMgr* padMgr) {
osContGetReadData(padMgr->pads); osContGetReadData(padMgr->pads);
for (i = 0; i < __osMaxControllers; i++) { 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) { if (padMgr->preNMIShutdown) {