another sync with trader fixes

This commit is contained in:
A Clark
2012-11-22 09:37:02 -06:00
parent da5766e46b
commit 638ceee5c6
152 changed files with 786 additions and 1579 deletions

View File

@@ -1,6 +1,7 @@
private["_position","_tent","_location","_isOk","_backpack","_tentType","_trg","_key"];
//check if can pitch here
call gear_ui_init;
_playerPos = getPosATL player;
_item = _this;
_hastentitem = _this in magazines player;
_location = player modeltoworld [0,2.5,0];
@@ -9,23 +10,28 @@ _building = nearestObject [(vehicle player), "HouseBase"];
_isOk = [(vehicle player),_building] call fnc_isInsideBuilding;
//_isOk = true;
diag_log ("Pitch Tent: " + str(_isok) );
//diag_log ("Pitch Tent: " + str(_isok) );
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
if (!_hastentitem) exitWith {cutText [format[(localize "str_player_31"),_text,"pitch"] , "PLAIN DOWN"]};
//allowed
if (["forest",dayz_surfaceType] call fnc_inString) then { _isOk = false; diag_log ("surface forest"); };
//if (["grass",dayz_surfaceType] call fnc_inString) then { _isOk = false; diag_log ("surface grass"); };
//blocked
if (["concrete",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
//if (["wood",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
//Block Tents in pounds
_objectsPond = nearestObjects [_playerPos, [], 10];
{
_isPond = ["pond",str(_x),false] call fnc_inString;
if (_isPond) then {
_pondPos = (_x worldToModel _playerPos) select 2;
if (_pondPos < 0) then {
_isOk = true;
};
};
} forEach _objectsPond;
diag_log ("Pitch Tent Surface: " + str(_isok) );
//diag_log ("Pitch Tent: " + str(_isok) );
if (!_isOk) then {
//remove tentbag