forked from Mirrorlandia_minetest/minetest
Fix signed/unsigned conversion warning
There was no bug here (as I checked for negativeness), however it's good to get rid of warnings.
This commit is contained in:
parent
c28a843592
commit
271d7c31e6
@ -170,12 +170,12 @@ void JoystickController::onJoystickConnect(const std::vector<irr::SJoystickInfo>
|
|||||||
s32 id = g_settings->getS32("joystick_id");
|
s32 id = g_settings->getS32("joystick_id");
|
||||||
std::string layout = g_settings->get("joystick_type");
|
std::string layout = g_settings->get("joystick_type");
|
||||||
|
|
||||||
if (id < 0 || id >= joystick_infos.size()) {
|
if (id < 0 || (u16)id >= joystick_infos.size()) {
|
||||||
// TODO: auto detection
|
// TODO: auto detection
|
||||||
id = 0;
|
id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id >= 0 && id < joystick_infos.size()) {
|
if (id >= 0 && (u16)id < joystick_infos.size()) {
|
||||||
if (layout.empty() || layout == "auto")
|
if (layout.empty() || layout == "auto")
|
||||||
setLayoutFromControllerName(joystick_infos[id].Name.c_str());
|
setLayoutFromControllerName(joystick_infos[id].Name.c_str());
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user