Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spikestrip rework #647

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Altis_Life.Altis/core/actions/fn_deploySpikes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ if (isNull life_spikeStrip) exitWith {};
private _spikeStrip = life_spikeStrip;
life_spikeStrip = objNull;

detach life_spikeStrip;
detach _spikeStrip;
private _pos = getPosASL _spikeStrip;
private _intersects = lineIntersectsSurfaces [_pos,_pos vectorAdd [0,0,-50],_spikeStrip,objNull,true,1,"GEOM","NONE"];
(_intersects) params ["_firstObjectData"];
_intersects params ["_firstObjectData"];
_firstObjectData params ["_posASL","_surfaceNormal"];
_spikeStrip setPosASL _posASL;
_spikeStrip setVectorUp _surfaceNormal;
Expand Down
2 changes: 1 addition & 1 deletion Altis_Life.Altis/core/items/fn_spikeStrip.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
private _maxSpikeCount = LIFE_SETTINGS(getNumber,"maximumSpikestrips");
life_spikesDeployed = life_spikesDeployed - [objNull];
if (_maxSpikeCount != -1 && {(count life_spikesDeployed) isEqualTo _maxSpikeCount}) exitWith {}; //max spikes placed
if (_maxSpikeCount != -1 && {(count life_spikesDeployed) isEqualTo _maxSpikeCount}) exitWith {hint format [localize "STR_ISTR_MaxSpikesDeployed", _maxSpikeCount]}; //max spikes placed

private _spikeStrip = "Land_Razorwire_F" createVehicle [0,0,0];
_spikeStrip attachTo [player,[0,5.5,0]];
Expand Down
4 changes: 2 additions & 2 deletions life_hc/MySQL/Items/fn_spikeStrip.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (isNull _spikeStrip) exitWith {};

hc_spikes pushBack _spikeStrip;

if (hc_spikes isEqualTo []) then { //start monitoring spikestrips
if (count hc_spikes isEqualTo 1) then { //start monitoring spikestrips
private _minSpikeSpeed = LIFE_SETTINGS(getNumber,"minimumSpikeSpeed");

for "_i" from 0 to 1 step 0 do {
Expand All @@ -30,7 +30,7 @@ if (hc_spikes isEqualTo []) then { //start monitoring spikestrips
deleteVehicle _x;
_toDelete pushBack _forEachIndex;
} else {
if (isNull _object) then {
if (isNull _x) then {
deleteVehicle _x;
DomT602 marked this conversation as resolved.
Show resolved Hide resolved
_toDelete pushBack _forEachIndex;
};
Expand Down
4 changes: 2 additions & 2 deletions life_server/Functions/Systems/fn_spikeStrip.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (isNull _spikeStrip) exitWith {};

server_spikes pushBack _spikeStrip;

if (server_spikes isEqualTo []) then { //start monitoring spikestrips
if (count server_spikes isEqualTo 1) then { //start monitoring spikestrips
private _minSpikeSpeed = LIFE_SETTINGS(getNumber,"minimumSpikeSpeed");

for "_i" from 0 to 1 step 0 do {
Expand All @@ -28,7 +28,7 @@ if (server_spikes isEqualTo []) then { //start monitoring spikestrips
deleteVehicle _x;
_toDelete pushBack _forEachIndex;
} else {
if (isNull _object) then {
if (isNull _x) then {
deleteVehicle _x;
_toDelete pushBack _forEachIndex;
};
Expand Down