mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-26 22:10:06 +00:00
Fix settings set not accepting boolean literals
Signed-off-by: Lucca Jiménez Könings <development@jimkoen.com>
This commit is contained in:
1 parent
639c46ad36
commit
ff812429ed
1 file changed
+9
-2
+9
-2
@@ -452,8 +452,15 @@ void TConsole::Command_Settings(const std::string&, const std::vector<std::strin
|
|||||||
},
|
},
|
||||||
[&args](bool keyValue) {
|
[&args](bool keyValue) {
|
||||||
// todo: implement other way to convert from string to bool
|
// todo: implement other way to convert from string to bool
|
||||||
Application::SettingsSingleton.setConsoleInputAccessMapping(ComposedKey(args.at(1), args.at(2)), std::stoi(args.at(3)));
|
if(args.at(3) == "true"){
|
||||||
Application::Console().WriteRaw(fmt::format("{}::{} := {}", args.at(1), args.at(2), std::stoi(args.at(3))));
|
Application::SettingsSingleton.setConsoleInputAccessMapping(ComposedKey(args.at(1), args.at(2)), true);
|
||||||
|
Application::Console().WriteRaw(fmt::format("{}::{} := {}", args.at(1), args.at(2), "true"));
|
||||||
|
}else if(args.at(3) == "false"){
|
||||||
|
Application::SettingsSingleton.setConsoleInputAccessMapping(ComposedKey(args.at(1), args.at(2)), false);
|
||||||
|
Application::Console().WriteRaw(fmt::format("{}::{} := {}", args.at(1), args.at(2), "false"));
|
||||||
|
}else{
|
||||||
|
beammp_errorf("Error when setting key: {}::{} : Unknown literal, use either 'true', or 'false' to set boolean values.", args.at(1), args.at(2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user