Don't close controller after SDL has quit (#642)
* Don't close controller after SDL has quit * Don't check if controller can rumble if null
This commit is contained in:
parent
926fd3f406
commit
e3267a4e9b
|
@ -101,10 +101,10 @@ namespace Ship {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SDLController::Close() {
|
bool SDLController::Close() {
|
||||||
if (CanRumble()) {
|
if (Cont != nullptr && SDL_WasInit(SDL_INIT_GAMECONTROLLER)) {
|
||||||
SDL_GameControllerRumble(Cont, 0, 0, 0);
|
if (CanRumble()) {
|
||||||
}
|
SDL_GameControllerRumble(Cont, 0, 0, 0);
|
||||||
if (Cont != nullptr) {
|
}
|
||||||
SDL_GameControllerClose(Cont);
|
SDL_GameControllerClose(Cont);
|
||||||
}
|
}
|
||||||
Cont = nullptr;
|
Cont = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue