Fix issue with heading being incorrectly handled

So we've been doing heading wrong all these years. You will need to run
a script to fix your quests and required SQL to fix DB.

This fixes a ton of random issues with headings and as gives us a better
resolution on headings :P
This commit is contained in:
Michael Cook (mackal)
2018-02-15 18:20:16 -05:00
parent 91d3851d76
commit a32dedeb48
17 changed files with 169 additions and 162 deletions
+34 -14
View File
@@ -194,32 +194,52 @@ uint32 rnd_hash( time_t t, clock_t c )
float EQ13toFloat(int d)
{
return ( float(d)/float(1<<2));
}
float NewEQ13toFloat(int d)
{
return ( float(d)/float(1<<6));
return static_cast<float>(d) / 64.0f;
}
float EQ19toFloat(int d)
{
return ( float(d)/float(1<<3));
return static_cast<float>(d) / 8.0f;
}
int FloatToEQ13(float d)
{
return int(d*float(1<<2));
}
int NewFloatToEQ13(float d)
{
return int(d*float(1<<6));
return static_cast<int>(d * 64.0f);
}
int FloatToEQ19(float d)
{
return int(d*float(1<<3));
return static_cast<int>(d * 8.0f);
}
float EQ12toFloat(int d)
{
return static_cast<float>(d) / 4.0f;
}
int FloatToEQ12(float d)
{
return static_cast<int>((d + 2048.0f) * 4.0f) % 2048;
}
float EQ10toFloat(int d)
{
return static_cast<float>(d) / 20.0f;
}
int FloatToEQ10(float d)
{
return static_cast<int>(d * 20.0f);
}
float EQSpeedRunToFloat(int d)
{
return static_cast<float>(d) / 40.0f;
}
int FloatToEQSpeedRun(float d)
{
return static_cast<int>(d * 40.0f);
}
/*