Fix floating point precision problems.

This commit is contained in:
jaynus 2015-05-15 22:10:47 -07:00
parent 10075c0d9e
commit fe462826b6
3 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ if(_sendToExtension) then {
_cmd = format["set_animation_state:%1,", (_vehicle getVariable[QGVAR(id), -1])];
{
_cmd = _cmd + format["%1,%2,", (_x select 0), ([(_x select 1)] call CBA_fnc_formatNumber)];
_cmd = _cmd + format["%1,%2,", (_x select 0), (_x select 1)];
} forEach _animationResults;
_cmd call FUNC(callExtension);

View File

@ -14,7 +14,7 @@ namespace ace {
const std::string & as_string() const { return _args[_index]; }
operator const std::string &() const { return as_string(); }
float as_float() const { return atof(_args[_index].c_str()); }
float as_float() const { float res = 0.0f; std::istringstream iss(_args[_index]); iss >> res; return res; }
operator float() const { return as_float(); }
int as_int() const { return atoi(_args[_index].c_str()); }

View File

@ -111,7 +111,7 @@ namespace ace {
lod(const ace::p3d::lod_p, const ace::p3d::model_p);
~lod();
uint32_t id;
float type;
uint32_t type;
vertex_table vertices;
ace::vector3<float> autocenter_pos;
std::map<std::string, named_selection_p> selections;