mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 14:26:09 +00:00
Lua: Fix float printing
Now prints 0, not 0.000000, etc.
This commit is contained in:
@@ -30,8 +30,11 @@ static std::string LuaToString(const sol::object Value, size_t Indent = 1) {
|
||||
}
|
||||
case sol::type::string:
|
||||
return Value.as<std::string>();
|
||||
case sol::type::number:
|
||||
return std::to_string(Value.as<float>());
|
||||
case sol::type::number: {
|
||||
std::stringstream ss;
|
||||
ss << Value.as<float>();
|
||||
return ss.str();
|
||||
}
|
||||
case sol::type::nil:
|
||||
case sol::type::none:
|
||||
return "<nil>";
|
||||
|
||||
Reference in New Issue
Block a user