forked from Giallustio/HeartsAndMinds
-
-
Notifications
You must be signed in to change notification settings - Fork 67
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 #383 from Vdauphin/Add-detect_military_building
Add: Detect military building
- Loading branch information
Showing
6 changed files
with
55 additions
and
28 deletions.
There are no files selected for viewing
9 changes: 3 additions & 6 deletions
9
=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/house_addWP.sqf
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
17 changes: 10 additions & 7 deletions
17
=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/house_addWP_loop.sqf
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,16 +1,19 @@ | ||
|
||
private ["_group","_house","_wp","_allpositions"]; | ||
params ["_group","_house"]; | ||
|
||
_group = _this select 0; | ||
_house = _this select 1; | ||
private _allpositions = _house buildingPos -1; | ||
private _copyallpositions = +_allpositions; | ||
|
||
_allpositions = _house buildingPos -1; | ||
if (btc_debug_log) then {diag_log format ["setWaypoint : count all pos %1 in %2 ", count _allpositions,_house];}; | ||
{ | ||
_wp = _group addWaypoint [_x, 0]; | ||
private _index = _copyallpositions find selectRandom(_copyallpositions); | ||
|
||
private _wp = _group addWaypoint [_copyallpositions deleteAt _index, 0.2]; | ||
_wp setWaypointType "MOVE"; | ||
_wp setWaypointCompletionRadius 0; | ||
_wp waypointAttachObject _house; | ||
_wp setWaypointHousePosition _foreachindex; | ||
_wp setWaypointHousePosition _index; | ||
_wp setWaypointTimeout [15, 20, 30]; | ||
} forEach _allpositions; | ||
} forEach _allpositions; | ||
|
||
_allpositions |
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
6 changes: 6 additions & 0 deletions
6
=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/getStructures.sqf
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
params ["_pos","_radius"]; | ||
|
||
private _structures = (nearestTerrainObjects [_pos, ["House", "BUNKER", "FORTRESS"], _radius]) select {gettext(configfile >> "CfgVehicles" >> typeof _x >> "editorSubcategory") isEqualTo "EdSubcat_Military"}; | ||
private _useful = _structures select {(format["%1", _x buildingPos 1] != "[0,0,0]" && {damage _x == 0} && {isNil {_x getVariable "btc_house_taken"}})}; | ||
_useful |