maxBuildingHeight now var as it is used oneachframe

This commit is contained in:
vbawol 2017-07-12 09:53:39 -05:00
parent 078014cd72
commit fd5f4cb1f9
4 changed files with 15 additions and 19 deletions

View File

@ -24,11 +24,9 @@ if (EPOCH_velTransform) then {
EPOCH_target setvelocitytransformation[_pos1, (EP_velocityTransformation select 0), _vel1, (EP_velocityTransformation select 1), _dir1, (EP_velocityTransformation select 2), _up1, (EP_velocityTransformation select 3), _interval]; EPOCH_target setvelocitytransformation[_pos1, (EP_velocityTransformation select 0), _vel1, (EP_velocityTransformation select 1), _dir1, (EP_velocityTransformation select 2), _up1, (EP_velocityTransformation select 3), _interval];
} else { } else {
_pos2 = player modelToWorld[EPOCH_X_OFFSET, EPOCH_Y_OFFSET, EPOCH_Z_OFFSET]; _pos2 = player modelToWorld[EPOCH_X_OFFSET, EPOCH_Y_OFFSET, EPOCH_Z_OFFSET];
_CfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig; if !(EPOCH_maxBuildingHeight == 0) then {
_maxBuildingHeight = getNumber(_CfgEpochClient >> "maxBuildingHeight"); if (_pos2 select 2 > EPOCH_maxBuildingHeight) then {
if !(_maxBuildingHeight == 0) then { _pos2 set[2, EPOCH_maxBuildingHeight];
if (_pos2 select 2 > _maxBuildingHeight) then {
_pos2 set[2, _maxBuildingHeight];
}; };
}; };
if ((_pos2 select 2) < 0) then { _pos2 set[2, 0] }; if ((_pos2 select 2) < 0) then { _pos2 set[2, 0] };
@ -61,7 +59,7 @@ if (!isNull EPOCH_currentTarget && vehicle player == player) then {
_icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa"; _icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa";
_color = [100,0,_stability,1] call EPOCH_colorRange; _color = [100,0,_stability,1] call EPOCH_colorRange;
}; };
case 1: { case 1: {
// _text = if (EPOCH_buildMode > 0) then[{_text}, { format ["Hold (%1)",EPOCH_keysBuildMode1 call BIS_fnc_keyCode] }]; // _text = if (EPOCH_buildMode > 0) then[{_text}, { format ["Hold (%1)",EPOCH_keysBuildMode1 call BIS_fnc_keyCode] }];
_stability = if (EPOCH_buildMode > 0) then[{_currentTarget getVariable["stability", 100]}, {100 - round(damage _currentTarget * 100)}]; _stability = if (EPOCH_buildMode > 0) then[{_currentTarget getVariable["stability", 100]}, {100 - round(damage _currentTarget * 100)}];
_icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa"; _icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa";

View File

@ -22,7 +22,7 @@
NOTHING NOTHING
*/ */
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_maxBuildingHeight","_CfgEpochClient","_maxHeight","_allowedSnapObjects","_allowedSnapPoints","_cfgBaseBuilding","_class","_create","_currentTarget","_dir2","_direction","_disallowed","_distance","_distanceMod","_distanceNear","_energyCost","_isSnap","_lastCheckTime","_nearestObject","_nearestObjectRaw","_newObj","_objSlot","_objType","_object","_oemType","_offset","_onContactEH","_pOffset","_playerdistance","_pos2","_prevSnapDistance","_previousDistanceNear","_rejectMove","_removeParts","_return","_simulClassConfig","_snapArrayPara","_snapArrayPerp","_snapDistance","_snapObjects","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPosition","_snapType","_textureSlot","_up2","_vel2","_velocityTransformation","_worldspace"]; private ["_allowedSnapObjects","_allowedSnapPoints","_cfgBaseBuilding","_class","_create","_currentTarget","_dir2","_direction","_disallowed","_distance","_distanceMod","_distanceNear","_energyCost","_isSnap","_lastCheckTime","_maxHeight","_nearestObject","_nearestObjectRaw","_newObj","_objSlot","_objType","_object","_oemType","_offset","_onContactEH","_pOffset","_playerdistance","_pos2","_prevSnapDistance","_previousDistanceNear","_rejectMove","_return","_simulClassConfig","_snapArrayPara","_snapArrayPerp","_snapDistance","_snapObjects","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPosition","_snapType","_textureSlot","_up2","_vel2","_velocityTransformation","_worldspace"];
//[[[end]]] //[[[end]]]
if !(isNil "EPOCH_simulSwap_Lock") exitWith{}; if !(isNil "EPOCH_simulSwap_Lock") exitWith{};
@ -63,10 +63,8 @@ if (isText(_simulClassConfig)) then {
if (_maxHeight == 0) then { if (_maxHeight == 0) then {
_maxHeight = 500; _maxHeight = 500;
}; };
_CfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig; if !(EPOCH_maxBuildingHeight == 0) then {
_maxBuildingHeight = getNumber(_CfgEpochClient >> "maxBuildingHeight"); _maxHeight = _maxHeight min EPOCH_maxBuildingHeight;
if !(_maxBuildingHeight == 0) then {
_maxHeight = _maxHeight min _maxBuildingHeight;
}; };
if (isArray(_snapObjects)) then { if (isArray(_snapObjects)) then {
_allowedSnapObjects = getArray(_snapObjects); _allowedSnapObjects = getArray(_snapObjects);

View File

@ -23,7 +23,7 @@
NOTHING NOTHING
*/ */
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_snapped","_EPOCH_1","_EPOCH_2","_allowedSnapObjects","_allowedSnapPoints","_arr_snapPoints","_baselineSnapPos","_cfgBaseBuilding","_class","_currentOffSet","_currentPos","_currentTarget","_dir2","_direction","_distance","_energyCost","_ins","_isSnap","_lastCheckTime","_maxHeight","_maxSnapDistance","_nearestObject","_nearestObjects","_numberOfContacts","_objSlot","_objType","_offSet","_offsetZPos","_pOffset","_pos1","_pos1_snap","_pos2","_pos2ATL","_pos2_snap","_pos_snapObj","_rejectMove","_simulClass","_snapChecks","_snapConfig","_snapDistance","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPos1","_snapPosition","_snapType","_stabilityCheck","_up2","_worldspace"]; private ["_AnchorPos","_EPOCH_1","_EPOCH_2","_MoveObject","_Snapdirection","_allowedSnapObjects","_allowedSnapPoints","_arr_snapPoints","_baselineSnapPos","_cfgBaseBuilding","_class","_currentOffSet","_currentPos","_currentTarget","_currentTargetAttachedTo","_dir2","_direction","_distance","_energyCost","_helper","_ins","_isSnap","_lastCheckTime","_maxHeight","_maxSnapDistance","_nearestObject","_nearestObjects","_newDirAndUp","_numberOfContacts","_objSlot","_objType","_offSet","_offsetZPos","_pOffset","_pos1_snap","_pos2","_pos2ATL","_pos2_snap","_pos_snapObj","_rejectMove","_simulClass","_snapChecks","_snapConfig","_snapDistance","_snapPointsPara","_snapPointsPerp","_snapPos","_snapPos1","_snapPosition","_snapType","_snapped","_stabilityCheck","_worldspace"];
//[[[end]]] //[[[end]]]
if !(isNil "EPOCH_simulSwap_Lock") exitWith{}; if !(isNil "EPOCH_simulSwap_Lock") exitWith{};
@ -71,10 +71,8 @@ if (_class != "") then {
}; };
}; };
_CfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig; if !(EPOCH_maxBuildingHeight == 0) then {
_maxBuildingHeight = getNumber(_CfgEpochClient >> "maxBuildingHeight"); _maxHeight = _maxHeight min EPOCH_maxBuildingHeight;
if !(_maxBuildingHeight == 0) then {
_maxHeight = _maxHeight min _maxBuildingHeight;
}; };
_objSlot = _object getVariable["BUILD_SLOT", -1]; _objSlot = _object getVariable["BUILD_SLOT", -1];
@ -123,7 +121,7 @@ if (_class != "") then {
_currentTargetAttachedTo = player; _currentTargetAttachedTo = player;
_AnchorPos = []; _AnchorPos = [];
_helper = objnull; _helper = objnull;
if (typeof EPOCH_target in ["CinderWallHalf_Ghost_EPOCH","WoodLargeWall_Ghost_EPOCH"]) then { if (typeof EPOCH_target in ["CinderWallHalf_Ghost_EPOCH","WoodLargeWall_Ghost_EPOCH"]) then {
_helper = "Sign_Arrow_Direction_Yellow_F" createVehicleLocal (getpos EPOCH_target); _helper = "Sign_Arrow_Direction_Yellow_F" createVehicleLocal (getpos EPOCH_target);
_helper attachto [EPOCH_target, [0, -0.5, 1]]; _helper attachto [EPOCH_target, [0, -0.5, 1]];
@ -253,7 +251,7 @@ if (_class != "") then {
_pos_snapObj = getposATL _nearestObject; _pos_snapObj = getposATL _nearestObject;
_pos_snapObj set[2, 0]; _pos_snapObj set[2, 0];
_direction = _direction - (_snapPos1 getDir _pos_snapObj); _direction = _direction - (_snapPos1 getDir _pos_snapObj);
} }
else { else {
_direction = 0; _direction = 0;
}; };
@ -325,7 +323,7 @@ if (_class != "") then {
{ {
detach _x; detach _x;
} forEach attachedObjects _currentTargetAttachedTo; } forEach attachedObjects _currentTargetAttachedTo;
if (!isnull _helper) then { if (!isnull _helper) then {
deletevehicle _helper; deletevehicle _helper;
}; };

View File

@ -66,6 +66,8 @@ rmx_var_dynamicHUD_groupCTRL = [];
EPOCH_keysActionPressed = false; //prevents EH spam EPOCH_keysActionPressed = false; //prevents EH spam
0 call EPOCH_clientKeyMap; 0 call EPOCH_clientKeyMap;
EPOCH_maxBuildingHeight = getNumber(_CfgEpochClient >> "maxBuildingHeight");
//ON INIT and RESPAWN //ON INIT and RESPAWN
call EPOCH_clientInit; call EPOCH_clientInit;