[Commands] Cleanup #summon Command. (#2145)

* [Commands] Cleanup #summon Command.
- Cleanup messages and logic.
- Add glm::vec4 overload for GMMove.
- Remove unused parameter from GMMove.
- Remove unnecessary Lua GMMove now that parameter is gone.

* Update summon.cpp

* Cleanup.
This commit is contained in:
Kinglykrab
2022-05-06 19:45:12 -04:00
committed by GitHub
parent fc484d0b1c
commit 0aeab11408
8 changed files with 119 additions and 98 deletions
+13 -1
View File
@@ -2433,7 +2433,7 @@ void Mob::ShowBuffList(Client* client) {
}
}
void Mob::GMMove(float x, float y, float z, float heading, bool SendUpdate) {
void Mob::GMMove(float x, float y, float z, float heading) {
m_Position.x = x;
m_Position.y = y;
m_Position.z = z;
@@ -2445,6 +2445,18 @@ void Mob::GMMove(float x, float y, float z, float heading, bool SendUpdate) {
}
}
void Mob::GMMove(const glm::vec4 &position) {
m_Position.x = position.x;
m_Position.y = position.y;
m_Position.z = position.z;
SetHeading(position.w);
mMovementManager->SendCommandToClients(this, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeAny);
if (IsNPC()) {
CastToNPC()->SaveGuardSpot(position);
}
}
void Mob::SendIllusionPacket(
uint16 in_race,
uint8 in_gender,