mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-21 19:06:29 +03:00
Fix tame_dog errors
Tame_dog_old and player_tameDog are not used.
This commit is contained in:
@@ -12,39 +12,28 @@
|
||||
_dog = Intended target of the script.
|
||||
*/
|
||||
|
||||
private ["_target","_caller","_id","_dog","_fsmid","_removed","_selected","_animalID","_textRemoved","_chanceToFail","_itemIn","_countIn"];
|
||||
_target = _this select 0;
|
||||
_caller = _this select 1;
|
||||
_id = _this select 2;
|
||||
private ["_target","_caller","_id","_dog","_fsmid","_textRemoved","_chanceToFail","_meat","_hasMeat"];
|
||||
//_target = _this select 0;
|
||||
//_caller = _this select 1;
|
||||
//_id = _this select 2;
|
||||
_dog = _this select 3;
|
||||
|
||||
_removed = 0;
|
||||
_itemIn = "FoodRaw";
|
||||
_countIn = 1;
|
||||
_selected = "";
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
|
||||
_hasMeat = false;
|
||||
{
|
||||
if (_x in Dayz_meatraw) exitWith {
|
||||
_hasMeat = true;
|
||||
_meat = _x;
|
||||
};
|
||||
if(_removed == 1) exitWith { _selected = _x; };
|
||||
} count magazines player;
|
||||
} count (magazines player);
|
||||
|
||||
// Only proceed if removed count matches
|
||||
if(_removed == _countIn) then {
|
||||
if (_hasMeat) then {
|
||||
player removeMagazine _meat;
|
||||
_textRemoved = getText(configFile >> "CfgMagazines" >> _meat >> "displayName");
|
||||
|
||||
// get name of item removed
|
||||
_textRemoved = getText(configFile >> "CfgMagazines" >> _selected >> "displayName");
|
||||
|
||||
// add failure rate based on skill level variable (days alive)
|
||||
_chanceToFail = (((random 1) + (dayz_Survived/100)) > 0.5);
|
||||
|
||||
if(!_chanceToFail) then {
|
||||
|
||||
_animalID = _dog getVariable "fsm_handle";
|
||||
_animalID setFSMVariable ["_isTamed", true];
|
||||
uiSleep 1;
|
||||
//diag_log format["DEBUG: %1, id: %2 [%3]",_dog,_animalID,completedFSM _animalID];
|
||||
_chanceToFail = (((random 1) + (dayz_Survived/100)) > 0.5);
|
||||
|
||||
if (!_chanceToFail) then {
|
||||
if (!moveToCompleted _dog) then {
|
||||
_dog moveTo ([_dog] call FNC_GetPos);
|
||||
};
|
||||
@@ -52,8 +41,8 @@ if(_removed == _countIn) then {
|
||||
(group _dog) setBehaviour "AWARE";
|
||||
_fsmid = [_dog, typeOf _dog] execFSM "\z\addons\dayz_code\system\dog_agent.fsm";
|
||||
_fsmid setFSMVariable ["_handle", _fsmid];
|
||||
_fsmid setFSMVariable ["_isTamed", true];
|
||||
player setVariable ["dogID", _fsmid];
|
||||
_dog setVariable ["fsm_handle", _fsmid];
|
||||
_dog setVariable ["CharacterID", dayz_characterID, true];
|
||||
|
||||
format[localize "str_epoch_player_173",_textRemoved] call dayz_rollingMessages;
|
||||
|
||||
Reference in New Issue
Block a user