mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
go fix
This commit is contained in:
parent
4758be3791
commit
a22b901775
1 changed files with 10 additions and 1 deletions
|
|
@ -123,7 +123,16 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float
|
|||
SetFloatValue(GAMEOBJECT_POS_Z, z);
|
||||
SetFloatValue(GAMEOBJECT_FACING, ang); //this is not facing angle
|
||||
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION, rotation0);
|
||||
int64 rotation = 0;
|
||||
float f_rot = sin(ang / 2.0f);
|
||||
int64 i_rot = f_rot / atan(pow(2.0f, -20.0f));
|
||||
rotation |= (i_rot << 43 >> 43) & 0x00000000001FFFFF;
|
||||
|
||||
sLog.outDebug("go_create: ang: %f, rot: " SI64FMTD, ang, rotation);
|
||||
|
||||
SetUInt64Value(GAMEOBJECT_ROTATION, rotation);
|
||||
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation0);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation1);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rotation2);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rotation3);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue