From fd5f4cb1f9b83fd0661a3d3e26533b8e86f85d2e Mon Sep 17 00:00:00 2001 From: vbawol Date: Wed, 12 Jul 2017 09:53:39 -0500 Subject: [PATCH] maxBuildingHeight now var as it is used oneachframe --- Sources/epoch_code/compile/EPOCH_onEachFrame.sqf | 10 ++++------ .../compile/building/EPOCH_simulSwap.sqf | 8 +++----- .../compile/building/EPOCH_staticMove.sqf | 14 ++++++-------- Sources/epoch_code/init/client_init.sqf | 2 ++ 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Sources/epoch_code/compile/EPOCH_onEachFrame.sqf b/Sources/epoch_code/compile/EPOCH_onEachFrame.sqf index ba07f88d..d5ac7189 100644 --- a/Sources/epoch_code/compile/EPOCH_onEachFrame.sqf +++ b/Sources/epoch_code/compile/EPOCH_onEachFrame.sqf @@ -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]; } else { _pos2 = player modelToWorld[EPOCH_X_OFFSET, EPOCH_Y_OFFSET, EPOCH_Z_OFFSET]; - _CfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig; - _maxBuildingHeight = getNumber(_CfgEpochClient >> "maxBuildingHeight"); - if !(_maxBuildingHeight == 0) then { - if (_pos2 select 2 > _maxBuildingHeight) then { - _pos2 set[2, _maxBuildingHeight]; + if !(EPOCH_maxBuildingHeight == 0) then { + if (_pos2 select 2 > EPOCH_maxBuildingHeight) then { + _pos2 set[2, EPOCH_maxBuildingHeight]; }; }; 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"; _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] }]; _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"; diff --git a/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf b/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf index ab136e1a..fd54e67e 100644 --- a/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf @@ -22,7 +22,7 @@ NOTHING */ //[[[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]]] if !(isNil "EPOCH_simulSwap_Lock") exitWith{}; @@ -63,10 +63,8 @@ if (isText(_simulClassConfig)) then { if (_maxHeight == 0) then { _maxHeight = 500; }; - _CfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig; - _maxBuildingHeight = getNumber(_CfgEpochClient >> "maxBuildingHeight"); - if !(_maxBuildingHeight == 0) then { - _maxHeight = _maxHeight min _maxBuildingHeight; + if !(EPOCH_maxBuildingHeight == 0) then { + _maxHeight = _maxHeight min EPOCH_maxBuildingHeight; }; if (isArray(_snapObjects)) then { _allowedSnapObjects = getArray(_snapObjects); diff --git a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf index d11088e0..ebbf61c7 100644 --- a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf @@ -23,7 +23,7 @@ NOTHING */ //[[[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]]] if !(isNil "EPOCH_simulSwap_Lock") exitWith{}; @@ -71,10 +71,8 @@ if (_class != "") then { }; }; - _CfgEpochClient = 'CfgEpochClient' call EPOCH_returnConfig; - _maxBuildingHeight = getNumber(_CfgEpochClient >> "maxBuildingHeight"); - if !(_maxBuildingHeight == 0) then { - _maxHeight = _maxHeight min _maxBuildingHeight; + if !(EPOCH_maxBuildingHeight == 0) then { + _maxHeight = _maxHeight min EPOCH_maxBuildingHeight; }; _objSlot = _object getVariable["BUILD_SLOT", -1]; @@ -123,7 +121,7 @@ if (_class != "") then { _currentTargetAttachedTo = player; _AnchorPos = []; _helper = objnull; - + if (typeof EPOCH_target in ["CinderWallHalf_Ghost_EPOCH","WoodLargeWall_Ghost_EPOCH"]) then { _helper = "Sign_Arrow_Direction_Yellow_F" createVehicleLocal (getpos EPOCH_target); _helper attachto [EPOCH_target, [0, -0.5, 1]]; @@ -253,7 +251,7 @@ if (_class != "") then { _pos_snapObj = getposATL _nearestObject; _pos_snapObj set[2, 0]; _direction = _direction - (_snapPos1 getDir _pos_snapObj); - } + } else { _direction = 0; }; @@ -325,7 +323,7 @@ if (_class != "") then { { detach _x; } forEach attachedObjects _currentTargetAttachedTo; - + if (!isnull _helper) then { deletevehicle _helper; }; diff --git a/Sources/epoch_code/init/client_init.sqf b/Sources/epoch_code/init/client_init.sqf index fc377461..0a7811ac 100644 --- a/Sources/epoch_code/init/client_init.sqf +++ b/Sources/epoch_code/init/client_init.sqf @@ -66,6 +66,8 @@ rmx_var_dynamicHUD_groupCTRL = []; EPOCH_keysActionPressed = false; //prevents EH spam 0 call EPOCH_clientKeyMap; +EPOCH_maxBuildingHeight = getNumber(_CfgEpochClient >> "maxBuildingHeight"); + //ON INIT and RESPAWN call EPOCH_clientInit;