diff --git a/source/src/command.cpp b/source/src/command.cpp index 6d8ffd70..57cffac3 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -328,4 +328,5 @@ int gt(int a, int b) { return (int)(a>b); }; COMMANDN(>, gt, ARG_2EXP); int strcmpa(char *a, char *b) { return strcmp(a,b)==0; }; COMMANDN(strcmp, strcmpa, ARG_2EST); -int rndn(int a) { return a>0 ? rnd(a) : 0; }; COMMANDN(rnd, rndn, ARG_1EXP); \ No newline at end of file +int rndn(int a) { return a>0 ? rnd(a) : 0; }; COMMANDN(rnd, rndn, ARG_1EXP); + diff --git a/source/src/hudgun.cpp b/source/src/hudgun.cpp index b37facf2..e14c60a1 100644 --- a/source/src/hudgun.cpp +++ b/source/src/hudgun.cpp @@ -127,4 +127,12 @@ void renderhudgun() }; }; +void preload_hudguns() +{ + loopi(NUMGUNS) + { + s_sprintfd(path)("weapons/%s", hudgunnames[i]); + loadmodel(path); + }; +}; diff --git a/source/src/protos.h b/source/src/protos.h index 32acf271..0eb8c965 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -231,6 +231,7 @@ extern void rendermodel(char *mdl, int anim, int tex, float rad, float x, float extern mapmodelinfo &getmminfo(int i); extern int findanim(const char *name); extern void loadskin(const char *dir, const char *altdir, Texture *&skin, model *m); +extern model *loadmodel(const char *name, int i = -1); extern void preload_hudguns(); extern void preload_mapmodels(); diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index cda1f50f..c98f06d9 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -50,7 +50,7 @@ COMMAND(mapmodelreset, ARG_NONE); hashtable mdllookup; -model *loadmodel(const char *name, int i = -1) +model *loadmodel(const char *name, int i) { if(!name) { @@ -159,8 +159,3 @@ void preload_mapmodels() }; }; -extern void renderhudgun(int gun, int lastaction, int index = 0); -void preload_hudguns() -{ - loopi(NUMGUNS) renderhudgun(i, 0); -} \ No newline at end of file