Scripts/Commands: update .wp commands to use orientation field from DB (PR #23566)

Closes #23330
This commit is contained in:
ForesterDev
2019-07-08 16:16:10 +04:00
committed by Treeston
parent 671052575a
commit e71773140c
3 changed files with 12 additions and 9 deletions

View File

@@ -1564,7 +1564,7 @@ public:
{
Player* player = handler->GetSession()->GetPlayer();
TC_LOG_INFO("sql.dev", "(@PATH, XX, %.3f, %.3f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
TC_LOG_INFO("sql.dev", "(@PATH, XX, %.3f, %.3f, %.5f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation());
handler->PSendSysMessage("Waypoint SQL written to SQL Developer log");
return true;

View File

@@ -135,6 +135,7 @@ public:
stmt->setFloat(2, player->GetPositionX());
stmt->setFloat(3, player->GetPositionY());
stmt->setFloat(4, player->GetPositionZ());
stmt->setFloat(5, player->GetOrientation());
WorldDatabase.Execute(stmt);
@@ -693,8 +694,9 @@ public:
stmt->setFloat(0, chr->GetPositionX());
stmt->setFloat(1, chr->GetPositionY());
stmt->setFloat(2, chr->GetPositionZ());
stmt->setUInt32(3, pathid);
stmt->setUInt32(4, point);
stmt->setFloat(3, chr->GetOrientation());
stmt->setUInt32(4, pathid);
stmt->setUInt32(5, point);
WorldDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_WAYPOINT_CHANGED);
@@ -864,12 +866,12 @@ public:
float x = fields[1].GetFloat();
float y = fields[2].GetFloat();
float z = fields[3].GetFloat();
float o = fields[4].GetFloat();
uint32 id = VISUAL_WAYPOINT;
Player* chr = handler->GetSession()->GetPlayer();
Map* map = chr->GetMap();
float o = chr->GetOrientation();
Creature* wpCreature = new Creature();
if (!wpCreature->Create(map->GenerateLowGuid<HighGuid::Unit>(), map, chr->GetPhaseMaskForSpawn(), id, { x, y, z, o }))
@@ -928,10 +930,11 @@ public:
float x = fields[0].GetFloat();
float y = fields[1].GetFloat();
float z = fields[2].GetFloat();
float o = fields[3].GetFloat();
uint32 id = VISUAL_WAYPOINT;
Player* chr = handler->GetSession()->GetPlayer();
float o = chr->GetOrientation();
Map* map = chr->GetMap();
Creature* creature = new Creature();