From ccb7f3170a02a3c11ce739ff58c2d27b9e933259 Mon Sep 17 00:00:00 2001 From: vbawol Date: Thu, 8 Oct 2015 14:54:40 -0500 Subject: [PATCH] 0.3.4 pt6 --- Changelogs/0.3.4.0.txt | 1 + .../@epochhive/addons/a3_epoch_server.pbo | Bin 360015 -> 360919 bytes .../compile/building/EPOCH_maintainIT.sqf | 3 +- .../EPOCH_KeyDown.sqf | 12 +++++-- .../epoch_bases/EPOCH_server_maintBUILD.sqf | 32 ++++++++++++------ .../epoch_vehicle/EPOCH_load_storage.sqf | 6 ++-- .../epoch_vehicle/EPOCH_save_storage.sqf | 8 ++++- 7 files changed, 45 insertions(+), 17 deletions(-) diff --git a/Changelogs/0.3.4.0.txt b/Changelogs/0.3.4.0.txt index f1148836..39713045 100644 --- a/Changelogs/0.3.4.0.txt +++ b/Changelogs/0.3.4.0.txt @@ -29,6 +29,7 @@ Server: [Fixed] Issue with trading vehicles that caused the trader data not to save or to save to the wrong slot. [Fixed] Added missing prices for female vests. [Fixed] Error Generic error in expression in EPOCH_server_repairVehicle. +[Changed] Base building maintain option now also maintains storage devices. [Changed] Vehicle spawn config that controls how many vehicles can spawn at different location types. See vehicleSpawnTypes array in the Map config in the server settings pbo. [Changed] Use new sort command instead of BIS_fncSortBy. [Changed] Use new worldSize command as default if maps worldSize setting in CfgEpoch does not exist. diff --git a/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo b/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo index 9f81f6aa7751281ab511a5482bf1a2c4d9df9571..bb1e18492ee08b427e1ed4f33b5156cbd80759cd 100644 GIT binary patch delta 626 zcmX^ANA!BL*aizGw%$WxVK=!aKV(*(p0|pLZ*xA=NnW;2pkSfIGAuR1UKgj zs4%jr00qBt0|n)$|J=>Qzxk-(c_yawCpS+M`Jf=G00d5@nK>z$dFcwiiJ5sNK)g9Z zWhUcfS)i#WO#@l@Gt(3lHRAJ=vQm>v6f*Os2Rbl`vTG`oWTfU*Pk+zMDk@k|TAbmO zn4GNuRaHCL)=G79f|ccT6MH5zW=>Ad>6!LSs?&9UGIMZiq$K7hrl%^zS7=Tbe8wz1 zS=U;5dY?U$&-AurCh^JsMTV0fSxHG$^Kt?80Rhl@4Xk>!9hiI}ditzenRJw6;#<|31|Y-GUBvVF{0*L>1u z`$-!{fsK>Fc}?m;s)44aq^2d7=9DM^O*4R*oLH<-o~n>o zl&X-IU!qW242p$JppuMCphRLNNM}6M5w;2j*1TL$vrrvp09J>^IbaRjnRS_7u(N>F zOm1|R+sAa<#3@bOCiH zHgS+hW}1SAMoMCCVtT3q)Qss4a!g{APuM6T87e>7#8zUmr(Nr0343E!uwm03o-x)n zpRwP5#-34NBOA~xeSL*#{7kajRX#GFH83$TH*b$z!UV+3+as5-WZe~ss}z(B VyV#eSkhdj8A@TmIxj$>y0RUKvcbfnJ diff --git a/Sources/epoch_code/compile/building/EPOCH_maintainIT.sqf b/Sources/epoch_code/compile/building/EPOCH_maintainIT.sqf index e04522b5..c50756cf 100644 --- a/Sources/epoch_code/compile/building/EPOCH_maintainIT.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_maintainIT.sqf @@ -3,7 +3,8 @@ if (EPOCH_playerCrypto > 0) then { _buildingJammerRange = getNumber(_config >> "buildingJammerRange"); if (_buildingJammerRange == 0) then { _buildingJammerRange = 75; }; - _maintainCount = {(damage _x) > 0} count nearestObjects[_this, ["Constructions_static_F", "Constructions_foundation_F"], _buildingJammerRange]; + _maintainCount = {(damage _x) > 0} count nearestObjects[_this, ["Constructions_static_F","Constructions_foundation_F","Constructions_lockedstatic_F","Buildable_Storage","Secure_Storage_Proxy"], _buildingJammerRange]; + if (EPOCH_playerCrypto < _maintainCount) then { _maintainCount = EPOCH_playerCrypto; }; diff --git a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf index d41f34e2..4a2717da 100644 --- a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf +++ b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf @@ -34,8 +34,12 @@ if (_ctrl && _dikCode == 0x0C) then { if (_dikCode == 0x01) then { if !(isNull EPOCH_Target) then { + if !(_vehicle isKindOf "ThingX") then { deleteVehicle EPOCH_Target; - _dt = ["Build Canceled", 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; + } else { + EPOCH_Target = objNull; + }; + _dt = ["Build Canceled", 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; }; if !(EPOCH_arr_interactedObjs isEqualTo[]) then { @@ -228,8 +232,12 @@ if (vehicle player == player) then { if (_dikCode in(actionKeys "Gear")) then { if !(isNull EPOCH_Target) then { + if !(_vehicle isKindOf "ThingX") then { deleteVehicle EPOCH_Target; - _dt = ["Build Canceled", 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; + } else { + EPOCH_Target = objNull; + }; + _dt = ["Build Canceled", 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; }; if (isTouchingGround player) then { _handled = call EPOCH_lootTrash; diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf index fc6cd4dd..69787a3a 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf @@ -1,8 +1,12 @@ /* -Building Maintain + Building Maintain + by Aaron Clark - EpochMod.com -Epoch Mod - EpochMod.com -All Rights Reserved. + This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. + http://creativecommons.org/licenses/by-nc-nd/4.0/ + + Improvements and or bugfixes and other contributions are welcome via the github: + https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf */ private["_object", "_plyr", "_maintCount", "_plyrUID", "_counter", "_objSlot", "_objHiveKey", "_buildingJammerRange", "_current_crypto", "_cIndex", "_vars"]; @@ -35,24 +39,30 @@ if (typeOf _object == "PlotPole_EPOCH") then { // maintain jammer _counter = _counter + 1; - _object call EPOCH_fnc_saveBuilding; + if !(_object in EPOCH_saveBuildQueue) then{EPOCH_saveBuildQueue pushBack _object}; if (_maintCount > 1) then { + // maintain all objects within range { - _object = _x; - _objSlot = _object getVariable["BUILD_SLOT", -1]; - if (_objSlot != -1) then { - if ((damage _object) > 0) then { + _storSlot = _x getVariable["STORAGE_SLOT", "ABORT"]; + if (_storSlot != "ABORT") then { + if ((damage _x) > 0) then { _counter = _counter + 1; - _object call EPOCH_fnc_saveBuilding; + if !(_x in EPOCH_saveStorQueue) then { EPOCH_saveStorQueue pushBack _x }; + }; + }; + _objSlot = _x getVariable["BUILD_SLOT", -1]; + if (_objSlot != -1) then{ + if ((damage _x) > 0) then { + _counter = _counter + 1; + if !(_x in EPOCH_saveBuildQueue) then{ EPOCH_saveBuildQueue pushBack _x }; }; }; if (_counter > _maintCount) exitWith{}; - } forEach nearestObjects[_object, ["Constructions_static_F","Constructions_foundation_F"], _buildingJammerRange]; + } forEach nearestObjects[_object, ["Constructions_static_F","Constructions_foundation_F","Constructions_lockedstatic_F","Buildable_Storage","Secure_Storage_Proxy"], _buildingJammerRange]; // effect crypto - _playerCryptoLimit = [(configFile >> "CfgSecConf" >> "limits"), "playerCrypto", 25000] call EPOCH_fnc_returnConfigEntry; _current_crypto = ((_current_crypto - _counter) min _playerCryptoLimit) max 0; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf index eba369a8..bba78baf 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf @@ -38,7 +38,9 @@ for "_i" from 1 to _this do { }; _vehicle = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"]; - // _vehicle setDamage _damage; + + // temp set damage to mark for maint + _vehicle setDamage 0.99; _vehicle setDir _dir; diag_log format ["STORAGE: created storage %1 at %2", _class, _location]; @@ -130,7 +132,7 @@ for "_i" from 1 to _this do { }; } forEach _x; - // add all attachments to vehicle + // add all attachments to vehicle // TODO replace with adding attachments directly to gun (Arma feature dependant) { _vehicle addItemCargoGlobal[_x, 1]; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_save_storage.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_save_storage.sqf index 88c417bf..506b9c9a 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_save_storage.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_save_storage.sqf @@ -7,7 +7,12 @@ if (!isNull _this) then { if (_vehSlot != "ABORT") then { _vehHiveKey = format ["%1:%2", (call EPOCH_fn_InstanceID),_vehSlot]; - _damage = damage _vehicle; + + // default to 0 damage as we are not using it this way + _damage = 0; + + // set damage to 0 + _vehicle setDamage 0; _pos = getposATL _vehicle call EPOCH_precisionPos; _dir = getDir _vehicle; @@ -66,6 +71,7 @@ if (!isNull _this) then { }; */ + _VAL = [_class, _worldspace, _damage, _inventory, _colorSlot, _storageOwners, _storageParent]; ["Storage", _vehHiveKey, EPOCH_expiresBuilding, _VAL] call EPOCH_fnc_server_hiveSETEX; //["Storage", _vehHiveKey, _VAL] call EPOCH_fnc_server_hiveSET;