diff --git a/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp b/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp index 3f76ff931..877bb471f 100644 --- a/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp +++ b/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp @@ -259,22 +259,6 @@ class SnapBuilding { {0,0,-1.685,"Bottom"} }; }; - class CinderWallDoorway_Preview_DZ: Cinder_DZE { - points[] = { - {0,0,0,"Pivot"}, - {-2.64, 0, 1.685,"Left"}, - {2.64, 0, 1.685,"Right"}, - {0, 0, 3.37042,"Top"} - }; - }; - class CinderWallSmallDoorway_Preview_DZ: Cinder_DZE { - points[] = { - {0,0,0,"Pivot"}, - {-2.64, 0, 1.685,"Left"}, - {2.64, 0, 1.685,"Right"}, - {0, 0, 3.37042,"Top"} - }; - }; class CinderWallDoorway_Preview_DZ: Cinder_DZE {}; class CinderWallSmallDoorway_Preview_DZ: Cinder_DZE {}; class CinderWallHalf_Preview_DZ: Cinder_DZE { diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf index 78911c60a..d2a9e0e95 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf @@ -1,4 +1,4 @@ -private ["_activatingPlayer","_bTotal","_backpack","_backpacksToBuy","_buyVehicle","_buyingType","_canBuy","_count","_dir","_enoughMoney","_hasPrimary","_helipad","_isKeyOK","_item2Add","_itemsToLog","_keyColor","_keyNumber","_keySelected","_location","_moneyInfo","_myMoney","_p","_parentClasses","_part_out","_pistolMagsToBuy","_price","_priceToBuy","_primaryToBuy","_regularMagsToBuy","_sidearmToBuy","_sign","_success","_tCost","_toolAmounts","_toolClasses","_toolsToBuy","_vehiclesToBuy","_weaponsToBuy","_worth"]; +private ["_activatingPlayer","_bTotal","_backpack","_backpacksToBuy","_buyVehicle","_buyingType","_canBuy","_count","_dir","_enoughMoney","_hasPrimary","_helipad","_isKeyOK","_item2Add","_itemsToLog","_keyColor","_keyNumber","_keySelected","_location","_moneyInfo","_myMoney","_parentClasses","_part_out","_pistolMagsToBuy","_priceToBuy","_primaryToBuy","_regularMagsToBuy","_sidearmToBuy","_sign","_success","_tCost","_toolAmounts","_toolClasses","_toolsToBuy","_vehiclesToBuy","_weaponsToBuy"]; if (count Z_BuyingArray < 1) exitWith { systemChat localize "STR_EPOCH_TRADE_BUY_NO_ITEMS"; }; @@ -28,7 +28,7 @@ if (Z_SingleCurrency) then { if ('PistolCore' in _parentClasses) then { _sidearmToBuy = _sidearmToBuy + (_x select 9); } else { - _primaryToBuy = _primaryToBuy + (_x select 9); // _amount + _primaryToBuy = _primaryToBuy + (_x select 9); }; }; _priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); @@ -43,11 +43,11 @@ if (Z_SingleCurrency) then { }; if (_x select 1 == "trade_backpacks") then { _backpacksToBuy = _backpacksToBuy + (_x select 9) ; - _priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); // _price * _amount + _priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); }; if ((_x select 1) in DZE_tradeVehicle) then { _vehiclesToBuy = _vehiclesToBuy + (_x select 9) ; - _priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); // _price * _amount + _priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); }; _itemsToLog set [0, (_itemsToLog select 0) + [_x select 0]]; _itemsToLog set [1, (_itemsToLog select 1) + [_x select 9]]; @@ -69,7 +69,7 @@ if (Z_SingleCurrency) then { _primaryToBuy = _primaryToBuy + (_x select 9); }; }; - _priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9)); // _worth * _price * _amount + _priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9)); }; if (_x select 1 == "trade_items") then { if (getNumber (configFile >> "CfgMagazines" >> (_x select 0) >> "type") == 16) then { // 16 = WeaponSlotHandGunItem (pistol ammo slot) @@ -120,7 +120,6 @@ if (!_success && _enoughMoney) exitWith { systemChat localize "STR_EPOCH_TRADE_G if (_enoughMoney) then { _bTotal = 0; _buyVehicle = { - private "_location"; _part_out = _this select 0; _buyingType = _this select 1; _keySelected = "0"; @@ -161,7 +160,8 @@ if (_enoughMoney) then { //systemChat localize "STR_EPOCH_PLAYER_105"; // "Stand still to complete trade". Medic animation loop no longer used. closeDialog 2; - + _item2Add = "0"; + if (Z_SellingFrom == 0) then { //backpack _backpack = unitBackpack player; { @@ -217,8 +217,7 @@ if (_enoughMoney) then { if (_x select 1 == "trade_weapons") then { _count = 0; while {_count < (_x select 9)} do { - _p = primaryWeapon player; - _hasPrimary = if (_p != "") then {true} else {false}; + _hasPrimary = if (primaryWeapon player != "") then {true} else {false}; if (_hasPrimary && getNumber (configFile >> "CfgWeapons" >> (_x select 0) >> "type") == 1) then { dayz_onBack = _x select 0; //Add to back } else { diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_canAfford.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_canAfford.sqf index a8792e0a1..5ce6f16a1 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_canAfford.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_canAfford.sqf @@ -1,4 +1,4 @@ -private ["_amounts","_backpackMoney","_backpackPlayer","_counter","_findGem","_forEachIndex","_inventoryMoney","_kinds","_mags","_part","_return","_totalToPay","_total_currency","_vehicleMoney","_worth"]; +private ["_amounts","_backpackMoney","_backpackPlayer","_counter","_findGem","_inventoryMoney","_kinds","_mags","_part","_return","_totalToPay","_total_currency","_vehicleMoney","_worth"]; _totalToPay = _this; _return = [false, [], [], [], 0]; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf index 148899a1f..6c7866c08 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf @@ -12,8 +12,8 @@ _typeOf = typeOf (unitBackPack player); _type = _x select 1; _count = 0; - if (_type in DZE_tradeVehicle && {_name == typeOf (DZE_myVehicle)} && {local DZE_myVehicle} && {alive DZE_myVehicle}) then { - _count = { (local _x && _x == DZE_myVehicle) } count (nearestObjects [(getPosATL player), [_name], Z_VehicleDistance]); + if (_type in DZE_tradeVehicle && {_name == typeOf Z_vehicle}) then { + _count = 1; }; if (_type == "trade_items") then { { @@ -26,8 +26,8 @@ _typeOf = typeOf (unitBackPack player); if (_type == "trade_weapons") then { _count = {_x == _name} count _weapons; }; - if (_type == "trade_backpacks") then { - if (_name == _typeOf) then { _count = 1; } + if (_type == "trade_backpacks" && {_name == _typeOf}) then { + _count = 1; }; if (_count > 0) then { diff --git a/SQF/dayz_server/compile/server_handleSafeGear.sqf b/SQF/dayz_server/compile/server_handleSafeGear.sqf index f8b0be9a1..9aac9eec4 100644 --- a/SQF/dayz_server/compile/server_handleSafeGear.sqf +++ b/SQF/dayz_server/compile/server_handleSafeGear.sqf @@ -1,4 +1,4 @@ -private ["_backpacks","_charID","_clientID","_dir","_dllcall","_holder","_lockBoxes","_lockCode","_lockColor","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons"]; +private ["_backpacks","_charID","_clientID","_dir","_holder","_lockCode","_lockColor","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons"]; _player = _this select 0; _obj = _this select 1; @@ -13,6 +13,7 @@ _charID = _obj getVariable ["CharacterID","0"]; _objectID = _obj getVariable ["ObjectID","0"]; _objectUID = _obj getVariable ["ObjectUID","0"]; _ownerID = _obj getVariable ["ownerPUID","0"]; +_lockCode = "0"; // Player may have disconnected or died before message send. Attempt lock/unlock/pack/save procedure anyway if (isNull _player) then {diag_log "ERROR: server_handleSafeGear called with Null player object";}; @@ -111,16 +112,14 @@ _type = switch _type do { }; case "LockboxStorage"; case "LockboxStorageLocked": { - _lockBoxes = ["LockboxStorage","LockboxStorageLocked"]; - if (_type in _lockBoxes) then { - _lockCode = parseNumber _charID; - _lockCode = _lockCode - 10000; - if (_lockCode <= 99) then { _lockColor = "Red"; }; - if (_lockCode >= 100 && _lockCode <= 199) then { _lockColor = "Green"; _lockCode = _lockCode - 100; }; - if (_lockCode >= 200) then { _lockColor = "Blue"; _lockCode = _lockCode - 200; }; - if (_lockCode <= 9) then { _lockCode = format["0%1", _lockCode]; }; - _lockCode = format ["%1%2",_lockColor,_lockCode]; - }; + _lockColor = ""; + _lockCode = parseNumber _charID; + _lockCode = _lockCode - 10000; + if (_lockCode <= 99) then { _lockColor = "Red"; }; + if (_lockCode >= 100 && _lockCode <= 199) then { _lockColor = "Green"; _lockCode = _lockCode - 100; }; + if (_lockCode >= 200) then { _lockColor = "Blue"; _lockCode = _lockCode - 200; }; + if (_lockCode <= 9) then { _lockCode = format["0%1", _lockCode]; }; + _lockCode = format ["%1%2",_lockColor,_lockCode]; "LockBox" }; }; @@ -128,4 +127,4 @@ _type = switch _type do { diag_log format["%1 (%2) %3 %4 with code: %5 @%6 (%7)",_name,_playerUID,_statusText,_type,_lockCode,mapGridPosition _pos,_pos]; dze_waiting = "success"; -_clientID publicVariableClient "dze_waiting"; \ No newline at end of file +_clientID publicVariableClient "dze_waiting";