Skip to content
Open
Changes from all commits
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
19 changes: 19 additions & 0 deletions addons/explosives/functions/fnc_setupExplosive.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,25 @@ GVAR(TweakedAngle) = 0;
if (GVAR(placeAction) == PLACE_APPROVE) then {
private _placeAngle = 0;
private _expSetupVehicle = _setupObjectClass createVehicle [0, 0, 0]; //(_virtualPosASL call EFUNC(common,ASLToPosition));
// Running it AGAIN in here because it needs the _expSetupVehicle Object for the boundingBox
private _intersect = lineIntersectsSurfaces [
eyePos _unit,
_basePosASL vectorAdd (_lookDirVector vectorMultiply PLACE_RANGE_MAX),
_unit, _expSetupVehicle, true, 1, "FIRE", "GEOM"
] param [0, []];
_virtualPosASL = if (_intersect isNotEqualTo []) then {
_intersect params ["_posASL", "_normal"];

if (_normal isEqualTo [0,0,0]) then {
_normal = surfaceNormal _posASL;
};
Comment on lines +212 to +214
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this part of the code supposed to catch?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here? probably nothing, i got some of my code from one of my scripts that had vectors in them, so it was probably left-over from something, in case the object bottom was pointing at the sky resets it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not optimistic about uncertain code - either give it a comment or remove it. surfaceNormal returns the normal to the terrain at that location, so it seems out of place.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, no, i will remove it, it was originally a code that would create an Ace circle tag where the explosive was, and when it was in a ramp in a certain modded object it returned 0,0,0 and would place a floating/clipping circle in the ramp, so that was a bandaid fix.

on the second hand, iirc if there isn't a FireGeo LOD it defaults to normal Geo right? i should probably replace "FireGeometry" here for for "Geometry" do you agree?


private _bbox = boundingBoxReal [_expSetupVehicle, "FireGeometry"];
private _offset = -((_bbox select 0) select 2);
_posASL vectorAdd (_normal vectorMultiply _offset);
} else {
_basePosASL vectorAdd (_lookDirVector vectorMultiply _distanceFromBase);
};

TRACE_1("Planting Mass",getMass _expSetupVehicle);

Expand Down
Loading