mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 12:01:25 +00:00
Make sure model fields are 0-filled, to avoid issues with models that are reloaded (eg when the user replaces them with a different type of model/etc.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6238 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
b8b77e2a1d
commit
9824304aa5
1 changed files with 3 additions and 2 deletions
|
@ -1086,6 +1086,9 @@ static void Mod_LoadModelWorker (void *ctx, void *data, size_t a, size_t b)
|
|||
char ext[8];
|
||||
int basedepth;
|
||||
|
||||
//clear out any old state.
|
||||
memset(&mod->loadstate+1, 0, sizeof(*mod) - (qintptr_t)(&((model_t*)NULL)->loadstate+1));
|
||||
|
||||
if (!*mod->publicname)
|
||||
{
|
||||
mod->type = mod_dummy;
|
||||
|
@ -1114,8 +1117,6 @@ static void Mod_LoadModelWorker (void *ctx, void *data, size_t a, size_t b)
|
|||
//
|
||||
// load the file
|
||||
//
|
||||
mod->maxlod = 0;
|
||||
mod->lightmaps.first = 0;
|
||||
// set necessary engine flags for loading purposes
|
||||
if (!strcmp(mod->publicname, "progs/player.mdl"))
|
||||
mod->engineflags |= MDLF_PLAYER | MDLF_DOCRC;
|
||||
|
|
Loading…
Reference in a new issue