Fix DZE_BuildHeightLimit behavior

Corrections for #1988
@BigEgg17 abs(_objHDiff) only tells you how much you have raised the
ghost from where it was when you started building. To test the actual
height above ground or sea level you need to use _position select 2.

Say DZE_BuildHeightLimit was 60m and DZE_buildMaxMoveDistance was 20m.
If the player started building at 55m and then raised the object 20m,
they would be allowed to build at 75m with your check.

Also getPosATL should not be used here. For example, I am swimming on
the surface of the water on Napf and getPosATL returns a height of 29m.

@oiad you missed zombie_wildGenerate.sqf in #1987
This commit is contained in:
ebayShopper
2017-11-14 13:09:15 -05:00
parent c1110fc61c
commit 14a6252911
4 changed files with 11 additions and 3 deletions

View File

@@ -358,7 +358,7 @@ if (_canBuild select 0) then {
deleteVehicle _objectHelper;
};
if (DZE_BuildHeightLimit > 0 && abs(_objHDiff) > DZE_BuildHeightLimit) exitWith {
if (DZE_BuildHeightLimit > 0 && {_position select 2 > DZE_BuildHeightLimit}) exitWith {
_isOk = false;
_cancel = true;
_reason = format[localize "STR_EPOCH_PLAYER_168",DZE_BuildHeightLimit];

View File

@@ -262,6 +262,14 @@ if (_canBuild select 0) then {
detach _object;
deleteVehicle _object;
};
if (DZE_BuildHeightLimit > 0 && {_position select 2 > DZE_BuildHeightLimit}) exitWith {
_isOk = false;
_cancel = true;
_reason = format[localize "STR_EPOCH_PLAYER_168",DZE_BuildHeightLimit];
detach _object;
deleteVehicle _object;
};
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {
_isOk = false;