Quote:
Originally Posted by Angelox
Cavedude had mentioned one temporary solution was to give the swimmers the levitation spell - This keeps them steady at what ever grid they are on.
|
I only just realised what a problem pathing in water was, even without the BestZ code. I.e. the client appears to make all the mobs sink to the bottom of the water. You can see this in powater at -232.25,-699.5,-98.125 ... mobs being put in a particular spot by the server, then sinking, and then popping up again when the server sends the next movement update.
I added an extra field to the Mob class, inWater, initialised to false. In the waypoint movement routine, I put a check to see if the mob is underwater and it wasn't previosly (Mob->inWater==false). If this is the case, it puts flymode 1 on the mob and sets Mob->inWater=true.
Likewise if the mob is not in water when it was on the last check, it turns the flymode off.
This seems to help in Powater and Kedge. The mobs hop once after the zone is loaded until they pass through the waypoint routine the first time, and then they swim as they should without the client making them sink. It won't help with static mobs which aren't on grids. They will just spawn and fall to the bottom and stay there. I guess I could put some code in the NPC spawn routine to check if they are in water and turn the flymode 1 on at that point. This would work for the static spawns and stop the initial hop for the wanderers.
I don't know whether there is any downside to doing this. Needs more testing. I wonder how the live servers handle it?