mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[11529] Pack and send to client all gameobject's quaternion components which allows place gameobjects cornerwise.
Update '.gobject turn' command, now you have to specify 3 rotations to turn gameobject: rotation angles around z, y and x axes. Note to DB devs: use QuaternionCompressed::Unpack to extract rotations from the data that came with UPDATEFLAG_ROTATION.
This commit is contained in:
parent
ab50a7d3e9
commit
7c86d3f477
8 changed files with 70 additions and 48 deletions
|
|
@ -958,23 +958,13 @@ bool ChatHandler::HandleGameObjectTurnCommand(char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
float o;
|
||||
if (!ExtractOptFloat(&args, o, m_session->GetPlayer()->GetOrientation()))
|
||||
return false;
|
||||
|
||||
Map* map = obj->GetMap();
|
||||
map->Remove(obj,false);
|
||||
|
||||
obj->Relocate(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), o);
|
||||
obj->UpdateRotationFields();
|
||||
|
||||
map->Add(obj);
|
||||
float z_rot, y_rot, x_rot;
|
||||
if (!ExtractFloat(&args, z_rot) || !ExtractOptFloat(&args, y_rot, 0) || !ExtractOptFloat(&args, x_rot, 0))
|
||||
return false;
|
||||
|
||||
obj->SetRotationAngles(z_rot, y_rot, x_rot);
|
||||
obj->SaveToDB();
|
||||
obj->Refresh();
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, obj->GetGUIDLow(), obj->GetGOInfo()->name, obj->GetGUIDLow());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue