2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

Bugfix: Prevent to pre-cache same local models twice and more (Affects #612)

This commit is contained in:
s1lent 2018-05-22 19:09:21 +07:00
parent 87a2d170ec
commit 65c6ce593b
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
3 changed files with 19 additions and 16 deletions

View File

@ -1345,7 +1345,6 @@ void EXT_FUNC EV_SV_Playback(int flags, int clientindex, unsigned short eventind
EV_Playback(flags,pEdict, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2); EV_Playback(flags,pEdict, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2);
} }
#ifdef REHLDS_FIXES
int SV_LookupModelIndex(const char *name) int SV_LookupModelIndex(const char *name)
{ {
if (!name || !name[0]) if (!name || !name[0])
@ -1369,7 +1368,6 @@ int SV_LookupModelIndex(const char *name)
return 0; return 0;
} }
#endif // REHLDS_FIXES
int EXT_FUNC PF_precache_model_I(const char *s) int EXT_FUNC PF_precache_model_I(const char *s)
{ {

View File

@ -79,6 +79,7 @@ void PF_setsize_I(edict_t *e, const float *rgflMin, const float *rgflMax);
void PF_setmodel_I(edict_t *e, const char *m); void PF_setmodel_I(edict_t *e, const char *m);
int PF_modelindex(const char *pstr); int PF_modelindex(const char *pstr);
int ModelFrames(int modelIndex); int ModelFrames(int modelIndex);
int SV_LookupModelIndex(const char *name);
void PF_bprint(char *s); void PF_bprint(char *s);
void PF_sprint(char *s, int entnum); void PF_sprint(char *s, int entnum);
void ServerPrint(const char *szMsg); void ServerPrint(const char *szMsg);

View File

@ -270,6 +270,9 @@ char *ED_ParseEdict(char *data, edict_t *ent)
{ {
// local model? // local model?
if (com_token[0] == '*') if (com_token[0] == '*')
{
// make sure that local model not pre-cached yet
if (!SV_LookupModelIndex(com_token))
{ {
// find empty slot // find empty slot
int i; int i;
@ -293,6 +296,7 @@ char *ED_ParseEdict(char *data, edict_t *ent)
#endif #endif
} }
} }
}
#endif #endif
kvd.szClassName = className; kvd.szClassName = className;