-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #299 from Global-Conflicts-ArmA/dev
Dev to master 1.1.8
- Loading branch information
Showing
135 changed files
with
2,635 additions
and
1,445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,62 @@ | ||
#include "script_component.hpp" | ||
|
||
private _anySide = sideEmpty; | ||
private _processingMarkers = []; | ||
private _allowedOutside = true; | ||
private _vehicle = (vehicle player); | ||
private _startPos = getPosATL _vehicle; | ||
player setVariable [QGVAR(pos), _startPos, false]; | ||
|
||
GVAR(markers) apply { | ||
_x params ["_side", "_name"]; | ||
|
||
if (_side == (side player) || _side == _anySide) then { | ||
_processingMarkers pushBack _name; | ||
|
||
if (_vehicle inArea _name) then { | ||
if (_side == (side player) || _side == sideEmpty) then { | ||
if (_vehicle inArea _name) exitWith { | ||
_allowedOutside = false; | ||
}; | ||
}; | ||
}; | ||
|
||
/* diag_log format ["INFO: Processing markers = %1", _processingMarkers]; */ | ||
|
||
private _delay = 0.1; | ||
[{ | ||
(_this select 0) params ["_vehicle1", "_processingMarkers1", "_allowedOutside1", "_startPos1"]; | ||
_vehicle1 = (vehicle player); | ||
private _pos = player getVariable [QGVAR(pos), _startPos1]; | ||
|
||
if !(_vehicle1 isKindOf "Air") then { | ||
GVAR(mainAOLimitLoop) = [{ | ||
params ["_args", "_idPFH"]; | ||
_args params [ | ||
"_allowedOutside", | ||
"_lastInPos" | ||
]; | ||
if (GVAR(markers) isEqualTo []) exitWith { | ||
[_idPFH] call CBA_fnc_removePerFrameHandler; | ||
}; | ||
private _vehicle = (vehicle player); | ||
if !(_vehicle isKindOf "Air") then { | ||
private _outSide = true; | ||
_processingMarkers1 apply { | ||
if (_vehicle1 inArea _x) exitWith { | ||
_outSide = false; | ||
//TRACE_1("starting AOLIMIT loop", GVAR(markers)); | ||
GVAR(markers) apply { | ||
_x params ["_side", "_name"]; | ||
if (_side == (side player) || _side == sideEmpty) then { | ||
if (_vehicle inArea _name) exitWith { | ||
_outSide = false; | ||
//TRACE_1("in AO marker", _name); | ||
}; | ||
}; | ||
}; | ||
|
||
if (_outSide) then { | ||
if (!(_allowedOutside1) && (_vehicle1 call EFUNC(FW,isAlive)) && local _vehicle1) then { | ||
_vehicle1 setPosATL _pos; | ||
_vehicle1 setVelocity (velocity _vehicle1 apply {- _x}); | ||
if ( | ||
!(_allowedOutside) && | ||
{(_vehicle call EFUNC(FW,isAlive))} && | ||
{local _vehicle} | ||
) then { | ||
//TRACE_1("outside all AOs, resetting pos", _lastInPos); | ||
_vehicle setPosATL _lastInPos; | ||
_vehicle setVelocity (velocity _vehicle apply {- _x}); | ||
} else { | ||
//TRACE_1("outside all AOs but allowed", _lastInPos); | ||
}; | ||
} else { | ||
_allowedOutside1 = false; | ||
player setVariable [QGVAR(pos), (getPosATL _vehicle1), false] | ||
_lastInPos = getPosATL _vehicle; | ||
//TRACE_1("in AO limit", _lastInPos); | ||
_allowedOutside = false; | ||
_args set [0, _allowedOutside]; | ||
_args set [1, _lastInPos]; | ||
}; | ||
} else { | ||
_allowedOutside1 = true; | ||
_allowedOutside = true; | ||
}; | ||
}, _delay, [_vehicle, _processingMarkers, _allowedOutside, _startPos]] call CBA_fnc_addPerFrameHandler; | ||
}, 0, [_allowedOutside, _startPos]] call CBA_fnc_addPerFrameHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.