Revisions for #1777 (#1778)

* Update z_at_buyItems.sqf

* Update z_at_buyItems.sqf

* Update z_at_canAfford.sqf

* Update z_at_fillBuyableList.sqf

All of this is already checked in z_checkCloseVehicle at startup. If Z_VehicleChanges between the time the menu is started and the buyable list is filled it's not a big deal, since it only affects the highlighted color.

* Update server_handleSafeGear.sqf

* Update snappoints.hpp

* Update z_at_buyItems.sqf
This commit is contained in:
ebaydayz
2016-10-25 13:59:56 -04:00
committed by GitHub
parent bef2506653
commit 84d549d0a1
5 changed files with 24 additions and 42 deletions

View File

@@ -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 {

View File

@@ -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,6 +160,7 @@ 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 {

View File

@@ -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];

View File

@@ -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 {

View File

@@ -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,8 +112,7 @@ _type = switch _type do {
};
case "LockboxStorage";
case "LockboxStorageLocked": {
_lockBoxes = ["LockboxStorage","LockboxStorageLocked"];
if (_type in _lockBoxes) then {
_lockColor = "";
_lockCode = parseNumber _charID;
_lockCode = _lockCode - 10000;
if (_lockCode <= 99) then { _lockColor = "Red"; };
@@ -120,7 +120,6 @@ _type = switch _type do {
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"
};
};