- fixed float <-> fixed conversion errors in Fragglescript.

This commit is contained in:
Christoph Oelckers 2016-04-08 15:14:26 +02:00
parent 06dc96b062
commit 39d03f12b1
2 changed files with 2 additions and 2 deletions

View file

@ -123,7 +123,7 @@ struct svalue_t
void setDouble(double dp) void setDouble(double dp)
{ {
value.f = fsfix(dp/65536); value.f = fsfix(dp * 65536);
type = svt_fixed; type = svt_fixed;
} }
}; };

View file

@ -93,7 +93,7 @@ double floatvalue(const svalue_t &v)
{ {
return return
v.type == svt_string ? atof(v.string) : v.type == svt_string ? atof(v.string) :
v.type == svt_fixed ? v.value.f * 65536. : v.type == svt_fixed ? v.value.f / 65536. :
v.type == svt_mobj ? -1. : (double)v.value.i; v.type == svt_mobj ? -1. : (double)v.value.i;
} }