mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
Make aggro space spheroidal on Z
By doubling the z difference used in distance calculation, mobs above or below the player will aggro less often.
This commit is contained in:
parent
86f17b6525
commit
73f8179836
@ -1174,7 +1174,7 @@ bool MobManager::aggroCheck(Mob *mob, time_t currTime) {
|
||||
|
||||
// height is relevant for aggro distance because of platforming
|
||||
int xyDistance = hypot(mob->appearanceData.iX - plr->x, mob->appearanceData.iY - plr->y);
|
||||
int distance = hypot(xyDistance, mob->appearanceData.iZ - plr->z);
|
||||
int distance = hypot(xyDistance, (mob->appearanceData.iZ - plr->z) * 2); // difference in Z counts twice
|
||||
|
||||
if (distance > mobRange || distance > closestDistance)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user