Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiplayer disconnected controller fixes #725

Merged

Conversation

briaguya-ai
Copy link
Collaborator

No description provided.

DrawKnownControllerDisconnected();
}
ImGui::EndPopup();
if (mPortIndexOfDisconnectedController == UINT8_MAX - 1) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was getting a ton of mismatched open/close popup errors, i assume something changed with modern menu to make it so this can just be simplified - seems to work having it this way now

Comment on lines +412 to +413
auto portIndexOfPhysicalDeviceThatHasBeenDisconnected =
GetPortIndexOfDisconnectedPhysicalDevice(sdlJoystickInstanceId);
Copy link
Collaborator Author

@briaguya-ai briaguya-ai Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetShipDeviceIndexOfDisconnectedPhysicalDevice closes the controller

so by the time this was being called

if (sdlButtonMapping->GetJoystickInstanceId() == sdlJoystickInstanceId) {

mController would already be null

int32_t SDLMapping::GetJoystickInstanceId() {
if (mController == nullptr) {

meaning it always didn't know what device was disconnected

moving this up here makes it not a problem

@Kenix3 Kenix3 merged commit 5e34a4e into Kenix3:main Dec 1, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants