mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[10529] Water level in movement use fixes.
* Move selection allowed upper and lower heights for target point into near point core function used for contact/close point selection. Selection base at possibility target point searcher fly/swim(or walk by water bottom). * Use vamp water level data so have proper water level in instances in movements. * Use increased ground search distance for water level case.
This commit is contained in:
parent
f92518ee14
commit
2170c9c919
13 changed files with 171 additions and 41 deletions
|
|
@ -58,11 +58,10 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
|
|||
// Limit height change
|
||||
const float distanceZ = rand_norm_f() * sqrtf(dist)/2.0f;
|
||||
nz = Z + distanceZ;
|
||||
float tz = map->GetHeight(nx, ny, nz-2.0f, false); // Map check only, vmap needed here but need to alter vmaps checks for height.
|
||||
float wz = map->GetWaterLevel(nx, ny);
|
||||
float tz = map->GetWaterOrGroundLevel(nx, ny, nz-2.0f);
|
||||
|
||||
// Problem here, we must fly above the ground and water, not under. Let's try on next tick
|
||||
if (tz >= nz || wz >= nz)
|
||||
if (tz >= nz)
|
||||
return;
|
||||
}
|
||||
//else if (is_water_ok) // 3D system under water and above ground (swimming mode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue