Skip to content

Commit

Permalink
Interaction Menu - Fix house actions icon (acemod#8641)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored and AndreasBrostrom committed Dec 3, 2021
1 parent 40f54c3 commit 0bf4565
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if ((vehicle ACE_player) != ACE_player) exitWith {};

_args set [0, (getPosASL ace_player)];
} else {
_houseBeingScaned = _housesToScanForActions deleteAt 0;
private _houseBeingScaned = _housesToScanForActions deleteAt 0;
private _typeOfHouse = typeOf _houseBeingScaned;
//Skip this house for now if we are outside of it's radius
//(we have to scan far out for the big houses, but we don't want to waste time adding actions on every little shack)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ private _memPointsActions = [];
//Get the offset for a memory point:
private _fnc_getMemPointOffset = {
params ["_memoryPoint"];
_memPointIndex = _memPoints find _memoryPoint;
_actionOffset = [0,0,0];
private _memPointIndex = _memPoints find _memoryPoint;
private _actionOffset = [0,0,0];
if (_memPointIndex == -1) then {
_memPoints pushBack _memoryPoint;
_memPointsActions pushBack [];
Expand Down Expand Up @@ -82,7 +82,7 @@ for "_index" from 0 to ((count _configPath) - 1) do {
private _actionStatement = getText (_actionPath >> "statement");
private _actionMaxDistance = getNumber (_actionPath >> "radius");

if (_actionDisplayName == "") then {_actionDisplayName = (configName _x);};
if (_actionDisplayName == "") then {_actionDisplayName = configName _actionPath;};
if (_actionPosition == "") then {ERROR("Bad Position");};
if (_actionCondition == "") then {_actionCondition = "true";};
if (_actionStatement == "") then {ERROR("No Statement");};
Expand All @@ -91,12 +91,12 @@ for "_index" from 0 to ((count _configPath) - 1) do {
_actionCondition = compile _actionCondition;
_actionMaxDistance = _actionMaxDistance + 0.1; //increase range slightly

private _iconImage = ((_actionDisplayNameDefault regexFind ["[\w\-\\\/]+.paa/gi", 0]) param [0, [""]]) select 0;
private _iconImage = ((_actionDisplayNameDefault regexFind ["[\w\-\\\/]+.paa/gi", 0]) param [0, []]) param [0, []] param [0, ""];

private _actionOffset = [_actionPosition] call _fnc_getMemPointOffset;
private _memPointIndex = _memPoints find _actionPosition;

_action = [(configName _actionPath), _actionDisplayName, _iconImage, _fnc_userAction_Statement, _fnc_userAction_Condition, {}, [_actionStatement, _actionCondition], _actionOffset, _actionMaxDistance, [false,false,false,false,true]] call EFUNC(interact_menu,createAction);
private _action = [(configName _actionPath), _actionDisplayName, _iconImage, _fnc_userAction_Statement, _fnc_userAction_Condition, {}, [_actionStatement, _actionCondition], _actionOffset, _actionMaxDistance, [false,false,false,false,true]] call EFUNC(interact_menu,createAction);
(_memPointsActions select _memPointIndex) pushBack _action;
};

Expand Down

0 comments on commit 0bf4565

Please sign in to comment.