-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5661fd8
commit fa967e7
Showing
4 changed files
with
49 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
PREP(createCasing); | ||
PREP(createLitter); | ||
PREP(createMagazine); |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
params ["_unit", "_modelPath", ["_force", false]]; | ||
|
||
if (_modelPath == "") exitWith {}; | ||
|
||
// Distant shooters don't produce as many cases | ||
if (!_force && ((AGLToASL positionCameraToWorld [0,0,0]) vectorDistance _unitPos > 100 && {random 1 < 0.9})) exitWith {}; | ||
|
||
private _unitPos = getPosASL _unit; | ||
private _weapDir = _unit weaponDirection currentWeapon _unit; | ||
private _ejectDir = _weapDir vectorCrossProduct [0, 0, 1]; | ||
private _pos = _unitPos | ||
vectorAdd (_weapDir vectorMultiply (-0.5 + random 2)) | ||
vectorAdd (_ejectDir vectorMultiply (0.2 + random 2)); | ||
|
||
[ | ||
{ | ||
params ["_modelPath", "_pos"]; | ||
TRACE_2("creating magazine",_modelPath,_pos); | ||
|
||
private _lisPos = (lineIntersectsSurfaces [_pos, _pos vectorAdd [0,0,-1e11], objNull, objNull, true, 1, "ROADWAY", "FIRE"]) #0; | ||
private _casing = createSimpleObject [_modelPath, (_lisPos #0 vectorAdd [0,0,0.010]), false]; // global | ||
_casing setDir (random 360); | ||
_casing setVectorUp _lisPos #1; | ||
private _idx = GVAR(casings) pushBack _casing; | ||
|
||
for "_" from 0 to (_idx - GVAR(maxCasings)) do { | ||
deleteVehicle (GVAR(casings) deleteAt 0); | ||
}; | ||
}, | ||
[_modelPath,_pos], | ||
0.4 | ||
] call CBA_fnc_waitAndExecute; |
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