Skip to content

Commit

Permalink
Fix major trace ray bug
Browse files Browse the repository at this point in the history
The trouble with trace rays and the resulting limitations revolved around
the mistake of defining the trace ray flags as constant. This constant
would be overwritten at a later point compromising the intended effect.
Thus, the trace ray would intersect with bounding boxes along other
problems. This is now fixed, rendering the previous spell fix unnecessary.
This commit marks a major improvement.
  • Loading branch information
szapp committed Feb 12, 2017
1 parent 0bcecea commit 51b621f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions _work/data/Scripts/Content/freeAim/_intern.d
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,7 @@ func int freeAimSetupAimVob(var int posPtr) {
/* Shoot aim-tailored trace ray. Do no use for other purposes. This function is customized for aiming. */
func int freeAimRay(var int distance, var int focusType, var int vobPtr, var int posPtr, var int distPtr,
var int trueDistPtr, var int maxPosPtr) {
// Flags: (VOB_IGNORE_NO_CD_DYN | POLY_IGNORE_TRANSP | VOB_IGNORE_PROJECTILES | POLY_TEST_WATER)
const int flags = (1<<0) | (1<<8) | (1<<9) | (1<<14); // Do not change (will make trace ray unstable)
var int flags; flags = (1<<0) | (1<<9) | (1<<14); // VOB_IGNORE_NO_CD_DYN | POLY_TEST_WATER | VOB_IGNORE_PROJECTILES
var zMAT4 camPos; camPos = _^(MEM_ReadInt(MEM_ReadInt(MEMINT_oGame_Pointer_Address)+20)+60); //0=right, 2=out, 3=pos
var int herPtr; herPtr = _@(hero);
// Shift the start point for the trace ray beyond the player model. Necessary, because if zooming out,
Expand Down

0 comments on commit 51b621f

Please sign in to comment.