Fix light fire and build fireplace over water #1866

Fixes #1866
This commit is contained in:
ebaydayz
2017-01-11 15:25:29 -05:00
parent b9d8b5798c
commit f25f5e96a6
10 changed files with 62 additions and 46 deletions

View File

@@ -544,7 +544,8 @@ if (_canBuild select 0) then {
} else { //if not lockable item
_tmpbuilt setVariable ["CharacterID",dayz_characterID,true];
// fire?
if(_tmpbuilt isKindOf "Land_Fire_DZ") then { //if campfire, then spawn, but do not publish to database
if (_tmpbuilt isKindOf "Land_Fire_DZ") then { //if campfire, then spawn, but do not publish to database
[_tmpbuilt,true] call dayz_inflame;
_tmpbuilt spawn player_fireMonitor;
} else {
if (DZE_permanentPlot) then {

View File

@@ -450,7 +450,8 @@ if (_canBuild select 0) then {
} else {
_tmpbuilt setVariable ["CharacterID",dayz_characterID,true];
// fire?
if(_tmpbuilt isKindOf "Land_Fire_DZ") then {
if (_tmpbuilt isKindOf "Land_Fire_DZ") then { //if campfire, then spawn, but do not publish to database
[_tmpbuilt,true] call dayz_inflame;
_tmpbuilt spawn player_fireMonitor;
} else {
if (DZE_permanentPlot) then {

View File

@@ -23,7 +23,7 @@ class ItemActions
};
};
*/
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_boiled","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_waterLevel","_waterLevel_lowest","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_boiled","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_waterLevel","_waterLevel_lowest","_reason","_isNear","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_63" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -94,20 +94,7 @@ if (_canDo) then {
while {_craft_doLoop} do {
_temp_removed_array = [];
_missing = "";
_missingTools = false;
{
_hastoolweapon = _x in weapons player;
if (_x == "ItemKnife") then {
{if (_x in Dayz_Gutting) exitWith {_hastoolweapon = true};} forEach (items player);
};
if (_x == "ItemMatchbox") then {
{if (_x in DayZ_Ignitors) exitWith {_hastoolweapon = true};} forEach (items player);
};
if (!_hastoolweapon) exitWith { _craft_doLoop = false; _missingTools = true; _missing = _x; };
} forEach _selectedRecipeTools;
if (!_missingTools) then {
if ([_item,_selectedRecipeTools,"none"] call dze_requiredItemsCheck) then {
// Dry run to see if all parts are available.
_proceed = true;
if (count _selectedRecipeInput > 0) then {
@@ -282,8 +269,7 @@ if (_canDo) then {
_craft_doLoop = false;
};
} else {
_textMissing = getText(configFile >> "CfgWeapons" >> _missing >> "displayName");
format[localize "STR_EPOCH_PLAYER_137",_textMissing] call dayz_rollingMessages;
//Missing text shown in dze_requiredItemsCheck
_craft_doLoop = false;
};
};

View File

@@ -1,4 +1,4 @@
private ["_item","_config","_exit","_text","_booleans","_worldspace","_dir","_location","_dis","_fire","_tool","_itemPile"];
private ["_item","_config","_exit","_text","_booleans","_worldspace","_dir","_location","_dis","_fire","_tool","_itemPile","_posASL","_testSea"];
_tool = _this;
call gear_ui_init;
@@ -11,15 +11,8 @@ _text = getText (_config >> "displayName");
_exit = false;
if (_tool == "PartWoodPile") then {
switch true do {
case ("Item1Matchbox" in (weapons player)): {_tool = "Item1Matchbox";};
case ("Item2Matchbox" in (weapons player)): {_tool = "Item2Matchbox";};
case ("Item3Matchbox" in (weapons player)): {_tool = "Item3Matchbox";};
case ("Item4Matchbox" in (weapons player)): {_tool = "Item4Matchbox";};
case ("Item5Matchbox" in (weapons player)): {_tool = "Item5Matchbox";};
case ("ItemMatchbox" in (weapons player)): {_tool = "ItemMatchbox";};
default {_exit = true;};
};
_exit = true;
{if (_x in DayZ_Ignitors) exitWith {_exit = false};} forEach (items player);
};
if (_exit) exitWith {(localize "str_fireplace_noMatches") call dayz_rollingMessages;};
@@ -35,8 +28,16 @@ _worldspace = ["Land_Fire_DZ", player, _booleans] call fn_niceSpot;
// player on ladder or in a vehicle
if (_booleans select 0) exitWith { localize "str_player_21" call dayz_rollingMessages; };
_testSea = true;
_posASL = getPosASL player;
if ((_booleans select 1) && _posASL select 2 > 2) then {
//Allow building on raised platform 2m+ ASL (like docks)
_testSea = false;
_worldspace = [0,_posASL];
};
// object would be in the water (pool or sea)
if ((_booleans select 1) OR (_booleans select 2)) exitWith { localize "str_player_26" call dayz_rollingMessages; };
if ((_booleans select 1 && _testSea) OR (_booleans select 2)) exitWith { localize "str_player_26" call dayz_rollingMessages; };
if ((count _worldspace) == 2) then {
if (_item in magazines player) then {
@@ -61,9 +62,13 @@ if ((count _worldspace) == 2) then {
uiSleep 5;
_fire = createVehicle ["Land_Fire_DZ", getMarkerpos "respawn_west", [], 0, "CAN_COLLIDE"];
_fire = createVehicle ["Land_Fire_DZ", [0,0,0], [], 0, "CAN_COLLIDE"];
_fire setDir _dir;
_fire setPos _location; // follow terrain slope
if (_testSea) then {
_fire setPos _location; // follow terrain slope
} else {
_fire setPosASL _location;
};
player reveal _fire;
[_fire,true] call dayz_inflame;
_fire spawn player_fireMonitor;
@@ -74,9 +79,7 @@ if ((count _worldspace) == 2) then {
achievement = [14, player, dayz_characterID];
publicVariableServer "achievement";
};*/
//localize "str_fireplace_01" call dayz_rollingMessages;
(localize "str_fireplace_01") call dayz_rollingMessages;
localize "str_fireplace_01" call dayz_rollingMessages;
} else {
//localize "str_fireplace_02" call dayz_rollingMessages;
(localize "str_fireplace_0") call dayz_rollingMessages;
localize "str_fireplace_02" call dayz_rollingMessages;
};