Derision
08-03-2008, 06:39 AM
At the moment, when CalculateNewPosition2 is called for:
Pet's following their master
Aggroed mobs pursuing a player
Mobs pathing back to their spawn point (because player is FD/Dead/Zoned)
it is called with the checkZ parameter omitted. This defaults to false, and therefore mobs/pets can 'bounce' or disappear under the world in these situations, particularly over uneven ground
(I performed my tests in nektulos, eastkarana, and commons).
In mob.h, around line 736 or so, find:
bool CalculateNewPosition2(float x, float y, float z, float speed, bool checkZ = false);
and change it to:
bool CalculateNewPosition2(float x, float y, float z, float speed, bool checkZ = true);
Note that there is both a CalculateNewPosition and CalculateNewPosition2 function. You can ignore the first one as it is no longer used.
In my testing this morning, this seems to work well in the scenarios I listed above. (It won't stop all occurrences of mobs disappearing under the world, as there are other reasons that happens).
Of course, the extra Z checks will add some extra CPU overhead, so anyone running a populated server should keep an eye on that if they make this change.
Pet's following their master
Aggroed mobs pursuing a player
Mobs pathing back to their spawn point (because player is FD/Dead/Zoned)
it is called with the checkZ parameter omitted. This defaults to false, and therefore mobs/pets can 'bounce' or disappear under the world in these situations, particularly over uneven ground
(I performed my tests in nektulos, eastkarana, and commons).
In mob.h, around line 736 or so, find:
bool CalculateNewPosition2(float x, float y, float z, float speed, bool checkZ = false);
and change it to:
bool CalculateNewPosition2(float x, float y, float z, float speed, bool checkZ = true);
Note that there is both a CalculateNewPosition and CalculateNewPosition2 function. You can ignore the first one as it is no longer used.
In my testing this morning, this seems to work well in the scenarios I listed above. (It won't stop all occurrences of mobs disappearing under the world, as there are other reasons that happens).
Of course, the extra Z checks will add some extra CPU overhead, so anyone running a populated server should keep an eye on that if they make this change.