mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 02:11:30 +00:00
[Pets] Client Pet summoned by NPC should not change guard location. (#2967)
* [Pets] Client Pet summoned by NPC should not change guard location. * Update mob.cpp --------- Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
parent
c13f9f80d9
commit
51f6108aab
34
zone/mob.cpp
34
zone/mob.cpp
@ -2374,14 +2374,14 @@ void Mob::ShowBuffList(Client* client) {
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::GMMove(float x, float y, float z, float heading) {
|
||||
void Mob::GMMove(float x, float y, float z, float heading, bool save_guard_spot) {
|
||||
m_Position.x = x;
|
||||
m_Position.y = y;
|
||||
m_Position.z = z;
|
||||
SetHeading(heading);
|
||||
mMovementManager->SendCommandToClients(this, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeAny);
|
||||
|
||||
if (IsNPC()) {
|
||||
if (IsNPC() && save_guard_spot) {
|
||||
CastToNPC()->SaveGuardSpot(glm::vec4(x, y, z, heading));
|
||||
}
|
||||
}
|
||||
@ -3714,10 +3714,32 @@ bool Mob::HateSummon() {
|
||||
// probably should be like half melee range, but we can't get melee range nicely because reasons :)
|
||||
new_pos = target->TryMoveAlong(new_pos, 5.0f, angle);
|
||||
|
||||
if (target->IsClient())
|
||||
target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), new_pos.x, new_pos.y, new_pos.z, new_pos.w, 0, SummonPC);
|
||||
else
|
||||
target->GMMove(new_pos.x, new_pos.y, new_pos.z, new_pos.w);
|
||||
if (target->IsClient()) {
|
||||
target->CastToClient()->MovePC(
|
||||
zone->GetZoneID(),
|
||||
zone->GetInstanceID(),
|
||||
new_pos.x,
|
||||
new_pos.y,
|
||||
new_pos.z,
|
||||
new_pos.w,
|
||||
0,
|
||||
SummonPC
|
||||
);
|
||||
} else {
|
||||
bool target_is_client_pet = (
|
||||
target->IsPet() &&
|
||||
target->IsPetOwnerClient()
|
||||
);
|
||||
bool set_new_guard_spot = !(IsNPC() && target_is_client_pet);
|
||||
|
||||
target->GMMove(
|
||||
new_pos.x,
|
||||
new_pos.y,
|
||||
new_pos.z,
|
||||
new_pos.w,
|
||||
set_new_guard_spot
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if(summon_level == 2) {
|
||||
|
||||
@ -686,7 +686,7 @@ public:
|
||||
float GetMovespeed() const { return IsRunning() ? GetRunspeed() : GetWalkspeed(); }
|
||||
bool IsRunning() const { return m_is_running; }
|
||||
void SetRunning(bool val) { m_is_running = val; }
|
||||
virtual void GMMove(float x, float y, float z, float heading = 0.01);
|
||||
virtual void GMMove(float x, float y, float z, float heading = 0.01, bool save_guard_spot = true);
|
||||
virtual void GMMove(const glm::vec4 &position);
|
||||
void SetDelta(const glm::vec4& delta);
|
||||
void MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct* spu);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user