mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[0048] Enable SMSG_MONSTER_MOVE, CMSG_SET_SELECTION and send normalized orientation in update and movement packets for client to react normally.
Signed-off-by: Yaki Khadafi <ElSolDolLo@gmail.com>
This commit is contained in:
parent
f592231863
commit
cfae212258
9 changed files with 32 additions and 30 deletions
|
|
@ -145,6 +145,21 @@ float GetFloatValueFromArray(Tokens const& data, uint16 index)
|
|||
return result;
|
||||
}
|
||||
|
||||
// modulos a radian orientation to the range of 0..2PI
|
||||
float NormalizeOrientation(float o)
|
||||
{
|
||||
// fmod only supports positive numbers. Thus we have
|
||||
// to emulate negative numbers
|
||||
if (o < 0)
|
||||
{
|
||||
float mod = o * -1;
|
||||
mod = fmod(mod, 2.0f * M_PI_F);
|
||||
mod = -mod + 2.0f * M_PI_F;
|
||||
return mod;
|
||||
}
|
||||
return fmod(o, 2.0f * M_PI_F);
|
||||
}
|
||||
|
||||
void stripLineInvisibleChars(std::string& str)
|
||||
{
|
||||
static std::string invChars = " \t\7\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue