mirror of
https://github.com/minetest/minetest.git
synced 2024-11-10 17:53:46 +01:00
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