Skip to content

Commit

Permalink
Fixed reversing mistake, missing checking string for null
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Sep 3, 2023
1 parent f955b07 commit 2ba27d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rehlds/engine/pr_cmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,9 @@ int EXT_FUNC PF_precache_model_I_internal(const char *s)
{
for (int i = 0; i < MAX_MODELS; i++)
{
if (!g_psv.model_precache[i])
continue;

// use case-sensitive names to increase performance
#ifdef REHLDS_FIXES
if (!Q_strcmp(g_psv.model_precache[i], s))
Expand Down Expand Up @@ -1545,7 +1548,7 @@ int EXT_FUNC PF_precache_generic_I_internal(const char *s)
{
for (int i = 0; i < MAX_GENERIC; i++)
{
if (!Q_stricmp(g_psv.generic_precache[i], s))
if (g_psv.generic_precache[i] && !Q_stricmp(g_psv.generic_precache[i], s))
return i;
}
Host_Error("%s: '%s' Precache can only be done in spawn functions", __func__, s);
Expand Down

0 comments on commit 2ba27d4

Please sign in to comment.