diff --git a/src/game_interpreter.cpp b/src/game_interpreter.cpp index c8799b43907..1d4e0c27232 100644 --- a/src/game_interpreter.cpp +++ b/src/game_interpreter.cpp @@ -2911,10 +2911,10 @@ bool Game_Interpreter::CommandKeyInputProc(lcf::rpg::EventCommand const& com) { } else { // For Rpg2k >=1.50 _keyinput.keys[Keys::eShift] = com.parameters[5] != 0; - _keyinput.keys[Keys::eDown] = param_size > 6 ? com.parameters[6] != 0 : false; - _keyinput.keys[Keys::eLeft] = param_size > 7 ? com.parameters[7] != 0 : false; - _keyinput.keys[Keys::eRight] = param_size > 8 ? com.parameters[8] != 0 : false; - _keyinput.keys[Keys::eUp] = param_size > 9 ? com.parameters[9] != 0 : false; + _keyinput.keys[Keys::eDown] = param_size > 6 && com.parameters[6] != 0; + _keyinput.keys[Keys::eLeft] = param_size > 7 && com.parameters[7] != 0; + _keyinput.keys[Keys::eRight] = param_size > 8 && com.parameters[8] != 0; + _keyinput.keys[Keys::eUp] = param_size > 9 && com.parameters[9] != 0; } } else { if (param_size != 10 || Player::IsRPG2k3Legacy()) { @@ -2925,17 +2925,17 @@ bool Game_Interpreter::CommandKeyInputProc(lcf::rpg::EventCommand const& com) { _keyinput.keys[Keys::eRight] = true; _keyinput.keys[Keys::eUp] = true; } - _keyinput.keys[Keys::eNumbers] = param_size > 5 ? com.parameters[5] != 0 : false; - _keyinput.keys[Keys::eOperators] = param_size > 6 ? com.parameters[6] != 0 : false; - _keyinput.time_variable = param_size > 7 ? com.parameters[7] : false; - _keyinput.timed = param_size > 8 ? com.parameters[8] != 0 : false; + _keyinput.keys[Keys::eNumbers] = param_size > 5 && com.parameters[5] != 0; + _keyinput.keys[Keys::eOperators] = param_size > 6 && com.parameters[6] != 0; + _keyinput.time_variable = param_size > 7 && com.parameters[7]; + _keyinput.timed = param_size > 8 && com.parameters[8] != 0; if (param_size > 10 && Player::IsMajorUpdatedVersion()) { // For Rpg2k3 >=1.05 _keyinput.keys[Keys::eShift] = com.parameters[9] != 0; _keyinput.keys[Keys::eDown] = com.parameters[10] != 0; - _keyinput.keys[Keys::eLeft] = param_size > 11 ? com.parameters[11] != 0 : false; - _keyinput.keys[Keys::eRight] = param_size > 12 ? com.parameters[12] != 0 : false; - _keyinput.keys[Keys::eUp] = param_size > 13 ? com.parameters[13] != 0 : false; + _keyinput.keys[Keys::eLeft] = param_size > 11 && com.parameters[11] != 0; + _keyinput.keys[Keys::eRight] = param_size > 12 && com.parameters[12] != 0; + _keyinput.keys[Keys::eUp] = param_size > 13 && com.parameters[13] != 0; } } else { // Since RPG2k3 1.05