-
Member
LOS check on retail
Hi, is anyone successfully using Traceline or Intersect to check los between two points with retail? If so I need your help!
There seems to be a number of Intersect functions, this is the Intersect() I'm using right now (build 57388) 0x2181540 (rebased) and GetCurrentWorldFrame() 0x23FB60 (rebased). Calling it like so:
Code:
bool check_los()
{
vec3 p1 = GetPlayerPos();
vec3 p2 = GetTargetPos();
vec3 res={0.0};
float dist = 1;
int flags = 0x100111; // also tried 0x900151
p1.z = p1.z + 3;
bool los = World_Intersect(GetCurrentWorldFrame(),&p1,&p2,&res,&dist,flags);
return los
}
I add some random height for now to check if it works, just getting 0 return the whole time - testing with position of target unit and my position + height offset. It looks like the reason maybe this check in Intersect function:
Code:
v11 = *(_QWORD *)(a1 + 8i64 * *(unsigned int *)(a1 + 32) + 16);
if ( !v11 )
return 0;
I checked the address at GetCurrentWorldFrame() + 0x20 and it's NULL... I think I must be calling the wrong Intersect, Any hints are appreciated!
-
Post Thanks / Like - 1 Thanks
numerbo (1 members gave Thanks to goblin2kx for this useful post)
-
Active Member
Maybe @blue_silvi can share his spell LOS function that doesn't use traceline. But here's how you use this one.
11.0.5.57534
Code:
const uintptr_t WORLD_TRACELINE = 0x20244b0;
const uintptr_t GET_CUR_WORLD_FRAME = 0x238290;
uintptr_t* result = MEM::INVOKE<uintptr_t*>(
_GetCurWorldFrame
);
char result = MEM::INVOKE<char, uintptr_t*, float*, float*, Vector3*, float*, uintptr_t>(
_WorldTraceline,
curWorldFrame,
from,
to,
out,
distance,
flags
);
For the version you referenced it was.
const uintptr_t WORLD_TRACELINE = 0x21813d0;
-
Post Thanks / Like - 1 Thanks
goblin2kx (1 members gave Thanks to numerbo for this useful post)
-
Member
Wow! I actually had a bug in my code, the original function I posted works just fine as well as the one numerbo posted.
Just to update 578534 of the function i originally posted as address 0x2024620.