Addition of CorrectPlayerZ configuration.
This commit is contained in:
@ -890,16 +890,10 @@ public class Config
|
||||
// --------------------------------------------------
|
||||
// GeoEngine
|
||||
// --------------------------------------------------
|
||||
|
||||
/** Geodata */
|
||||
public static String GEODATA_PATH;
|
||||
public static int COORD_SYNCHRONIZE;
|
||||
|
||||
/** Path checking */
|
||||
public static int PART_OF_CHARACTER_HEIGHT;
|
||||
public static int MAX_OBSTACLE_HEIGHT;
|
||||
|
||||
/** Path finding */
|
||||
public static boolean PATHFINDING;
|
||||
public static String PATHFIND_BUFFERS;
|
||||
public static int BASE_WEIGHT;
|
||||
@ -907,6 +901,7 @@ public class Config
|
||||
public static int HEURISTIC_WEIGHT;
|
||||
public static int OBSTACLE_MULTIPLIER;
|
||||
public static int MAX_ITERATIONS;
|
||||
public static boolean CORRECT_PLAYER_Z;
|
||||
|
||||
/** Attribute System */
|
||||
public static int S_WEAPON_STONE;
|
||||
@ -2406,6 +2401,7 @@ public class Config
|
||||
OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10);
|
||||
HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20);
|
||||
MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500);
|
||||
CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false);
|
||||
|
||||
// Load AllowedPlayerRaces config file (if exists)
|
||||
final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE);
|
||||
|
@ -12523,6 +12523,14 @@ public class PlayerInstance extends Playable
|
||||
}
|
||||
if (_fallingDamageTask != null)
|
||||
{
|
||||
if (Config.CORRECT_PLAYER_Z)
|
||||
{
|
||||
final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ());
|
||||
if (getZ() < nearestZ)
|
||||
{
|
||||
teleToLocation(new Location(getX(), getY(), nearestZ));
|
||||
}
|
||||
}
|
||||
_fallingDamageTask.cancel(true);
|
||||
}
|
||||
_fallingDamageTask = ThreadPool.schedule(() ->
|
||||
|
Reference in New Issue
Block a user