Fixed TR_GetEntityIndex returning -1 for world ent hits (Logical entities bcompat break)

This commit is contained in:
Matt Woodrow 2009-09-05 19:36:12 +12:00
parent db97c2a5b1
commit 3cfc45c4e8
2 changed files with 9 additions and 3 deletions

View File

@ -965,6 +965,7 @@
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="BINARY_NAME=\&quot;$(TargetFileName)\&quot;"
AdditionalIncludeDirectories="..\..\..\public"
/>
<Tool
Name="VCPreLinkEventTool"

View File

@ -504,6 +504,11 @@ static cell_t smn_TRGetEntityIndex(IPluginContext *pContext, const cell_t *param
return pContext->ThrowNativeError("Invalid Handle %x (error %d)", params[1], err);
}
if (tr->m_pEnt == NULL)
{
return 0;
}
return gamehelpers->EntityToBCompatRef(tr->m_pEnt);
}