mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Resolve issues with NPC's hopping to the ceiling in small corridors
Improved grounding issues with NPC's during combat Improved scenarios where NPC's need to be dragged out of the ground - they should correct themselves far more consistently - Scenarios where an NPC is coming up from the bottom floor, or from the top floor, they will correct much better - A video of these tests can be found here: https://www.youtube.com/watch?v=HtC7bVNM7ZQ&feature=youtu.be
This commit is contained in:
+9
-2
@@ -998,9 +998,16 @@ void Mob::AI_Process() {
|
||||
|
||||
/* Fix Z when following during pull, not when engaged and stationary */
|
||||
if (moving && fix_z_timer_engaged.Check())
|
||||
if(this->GetTarget())
|
||||
if(DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition()) > 50)
|
||||
if (this->GetTarget()) {
|
||||
/* If we are engaged, moving and following client, let's look for best Z more often */
|
||||
if (DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition()) > 50) {
|
||||
this->FixZ();
|
||||
}
|
||||
/* If we are close to client and our Z differences aren't big, match the client */
|
||||
else if (std::abs(this->GetZ() - this->GetTarget()->GetZ()) < 20){
|
||||
this->m_Position.z = this->GetTarget()->GetZ();
|
||||
}
|
||||
}
|
||||
|
||||
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
|
||||
SendAddPlayerState(PlayerState::Aggressive);
|
||||
|
||||
Reference in New Issue
Block a user