+ New crafting recipe: 1 woodpile + 1 razor = 3 wooden arrows.
+ Helicopter crash sites use HeliCrashArea variable dayz_MapArea / 2
instead of static 4000m
+ More building loot positions for Taviana 1.0
+ Supply crates no longer sunk into the ground.
+ Fixed crafting system was incorrectly counting removed items and added
refunds if failure.
+ Updated SQL to add traders_data for taviana and zargabad.
This commit is contained in:
vbawol
2013-03-28 10:02:12 -05:00
parent ead1180616
commit bf5a069f33
9 changed files with 1194 additions and 973 deletions

View File

@@ -65,6 +65,9 @@ TradeInprogress = true;
// _recipe_FoodBeefBakedBeans = [["FoodbeefRaw",1],["FoodCanBakedBeans",1]];
// ItemSalt
// temp array of removed parts
_temp_removed_array = [];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
@@ -137,32 +140,31 @@ if (_isFireNear >= 1 and _canDo) then {
if (_finished) then {
_removed = 0; // count total of removed items
_removed_total = 0; // count total of removed items
_tobe_removed_total = 0; // count total of all to be removed items
// Take items
{
_removed = 0;
_itemIn = _x select 0;
_countIn = _x select 1;
diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
_tobe_removed_total = _tobe_removed_total + _countIn;
{
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
// diag_log format["removing: %1 kindOf: %2", _x, _itemIn];
// player removeMagazine _x;
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
_removed_total = _removed_total + _removed;
_temp_removed_array set [count _temp_removed_array,_x];
};
} forEach magazines player;
} forEach _selectedRecipeInput;
diag_log format["removing: %1 kindOf: %2", _removed, _tobe_removed_total];
diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
// Only proceed if all parts were removed successfully
if(_removed == _tobe_removed_total) then {
if(_removed_total == _tobe_removed_total) then {
// Put items
{
@@ -183,7 +185,10 @@ if (_isFireNear >= 1 and _canDo) then {
} forEach _selectedRecipeOutput;
} else {
cutText [format["Missing Parts after first check Item: %1 / %2",_removed,_tobe_removed_total], "PLAIN DOWN"];
// Refund parts since we failed
{player addMagazine _x;} forEach _temp_removed_array;
cutText [format["Missing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
};
} else {

View File

@@ -4,8 +4,8 @@ _iClass = _this select 1;
_iPos = _this select 2;
_radius = _this select 3;
_iPosZ = _iPos select 2;
if( _iPosZ < 0 ) then { _iPos = [_iPos select 0,_iPos select 1,0]; };
//_iPosZ = _iPos select 2;
//if( _iPosZ < 0 ) then { _iPos = [_iPos select 0,_iPos select 1,0]; };
switch (_iClass) do {
default {

View File

@@ -2631,6 +2631,14 @@ class HeliCrash_No50s: Default {
lootPos[] = {{0.0878906,0.793457,-10.8154},
{-0.810547,3.44824,-10.8154}};
};
class LAND_Big_Panelak : Residential
{
lootPos[] = {{3.30566,-9.23413,-14.7521},
{3.10059,-7.05005,-14.7521},
{5.36914,0.495361,-14.7521},
{-0.236328,-3.16772,-14.7521},
{3.05078,-0.838379,-14.7521}};
};
class LAND_Posta : Residential
{