Fixed SetView (by always hooking Spawn and precaching the needed dummy model rpgrocket.mdl)

This commit is contained in:
Johnny Bergström
2004-10-27 19:06:43 +00:00
parent ddfba00791
commit 8f18856e91
2 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,7 @@ CVector<EntClass *> Thinks;
CVector<Touch *> Touches;
KeyValueData *g_pkvd;
bool g_inKeyValue=false;
bool g_precachedStuff = false;
int fstrcmp(const char *s1, const char *s2)
{
@ -37,6 +38,11 @@ int fstrcmp(const char *s1, const char *s2)
}
int Spawn(edict_t *pEntity) {
if (!g_precachedStuff) {
// Used for SetView, added by JGHG
int returnValue = PRECACHE_MODEL("models/rpgrocket.mdl");
g_precachedStuff = true;
}
if (SpawnForward != -1) {
int retVal = 0;
int id = ENTINDEX(pEntity);