From a3aa08637504f0a4aff7f01a2081f4394d5e8b77 Mon Sep 17 00:00:00 2001 From: arkshine Date: Wed, 13 Feb 2013 00:27:53 -0800 Subject: [PATCH] Fix crash in EngFunc_TraceTexture (bug 4576, r=dvander). Former-commit-id: c439946a3451dbdfafa2f542e08bc7f83d586165 --- dlls/fakemeta/engfunc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/fakemeta/engfunc.cpp b/dlls/fakemeta/engfunc.cpp index c4d278f8..d1078a7b 100755 --- a/dlls/fakemeta/engfunc.cpp +++ b/dlls/fakemeta/engfunc.cpp @@ -521,8 +521,8 @@ static cell AMX_NATIVE_CALL engfunc(AMX *amx, cell *params) Vec2[2]=amx_ctof(cRet[2]); temp = (char*)(*g_engfuncs.pfnTraceTexture)(INDEXENT2(index),Vec1,Vec2); cRet = MF_GetAmxAddr(amx,params[6]); - MF_SetAmxString(amx, params[5], temp, cRet[0]); - return 1; + MF_SetAmxString(amx, params[5], (temp == NULL) ? "NoTexture" : temp, cRet[0]); + return (temp != NULL); // pfnTraceSphere