View Single Post
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-21-2022 , 12:08   Re: [L4D2] Crash on CNavLadder::GetPosAtHeight
Reply With Quote #8

I couldn't find the linux crash logs to see the problem. Thanks for linking.

Then need to test if the ptr is valid. How could we do that? Read that memory location and check some of the data, comparing to what's "normal" values maybe?

PHP Code:
    vPos[0] = view_as<float>(LoadFromAddress(view_as<Address>(pThis 4), NumberType_Int32));
    
vPos[1] = view_as<float>(LoadFromAddress(view_as<Address>(pThis 8), NumberType_Int32));
    
vPos[2] = view_as<float>(LoadFromAddress(view_as<Address>(pThis 12), NumberType_Int32));
    
PrintToChatAll("A %d == %0.2f %0.2f %0.2f"pThisvPos[0], vPos[1], vPos[2]); 
This is the ladder position. But the "func_simpleladder" entity has no position vector that I can see. All return 0,0,0. If we could get that and check for nearby ladders then maybe that's a solution, if the crash happens from these ladders not existing for whatever reason. Although I deleted all ladders and the function still triggers fine. Maybe the address becomes invalid and therefore the data would be invalid, so still checking for a nearby ladder would solve the issue.
__________________

Last edited by Silvers; 01-21-2022 at 12:42.
Silvers is offline