View Single Post
Xutax_Kamay
Member
Join Date: Feb 2016
Old 04-16-2019 , 21:13   Re: [CS:GO] fire bullet fix (hit registration fix plugin)
Reply With Quote #19

Quote:
Originally Posted by sazonische View Post
No, everything works
That's very odd, because it doesn't for me. What mm/sm version you're using?

By the way, to make it work you need to set MRES_Supercede instead of MRES_Ignored (otherwhise the return value gets simply ignored), if you did that change and it worked, then good for you, otherwhise it's the same behavior I have currently.

After further investigations, the crash seems to appear at on line 749 on vhook.cpp of dhooks extension:

Code:
*vec_result = **(SDKVector **)returnStruct->newResult;
**(SDKVector **) is wrong it should be *(SDKVector *)

because of how is working this native

Code:
cell_t Native_SetReturnVector(IPluginContext *pContext, const cell_t *params)
{
	HookReturnStruct *returnStruct;
	
	if(!GetHandleIfValidOrError(g_HookReturnHandle, (void **)&returnStruct, pContext, params[1]))
	{
		return 0;
	}

	cell_t *buffer;
	pContext->LocalToPhysAddr(params[2], &buffer);

	if(returnStruct->type == ReturnType_Vector)
	{
		*(SDKVector *)returnStruct->newResult = SDKVector(sp_ctof(buffer[0]), sp_ctof(buffer[1]), sp_ctof(buffer[2]));
		returnStruct->isChanged = true;

		return 1;
	}
	else if(returnStruct->type == ReturnType_VectorPtr)
	{
		returnStruct->newResult = new SDKVector(sp_ctof(buffer[0]), sp_ctof(buffer[1]), sp_ctof(buffer[2]));
		returnStruct->isChanged = true;
		
		return 1;
	}

	return pContext->ThrowNativeError("Return type is not a vector type");
}
It should work after that change, I'll keep you informed


EDIT:

Yep it works, I'll ask Drifter to make this change, and cleaning up my messy code so I can release it

EDIT2:

Should work now for both linux & windows, keep me informed if it loads correctly for you, thanks.

Last edited by Xutax_Kamay; 04-17-2019 at 03:59.
Xutax_Kamay is offline