set bot_navigation_ignoreplayers 0 // FIXME remove this once the issue is solved
set bot_sound_monopoly 0 "when enabled, only bots can make any noise"
-// broken, sorry (cannot handle weapon attachment properly)
-//seta cl_forceplayermodels 0 "force all players to look like you; WARNING: animations can look very bad with this"
-//seta cl_forceplayermodelsfromxonotic 0 "force models coming from xonotic; WARNING: animations can look very bad with this"
-//set sv_clforceplayermodels 1 "allow clients to use cl_forcemodels"
-
set sv_loddistance1 1024
set sv_loddistance2 4096
seta cl_playerdetailreduction 0 "the higher, the less detailed player models are displayed (LOD)"
set g_debug_bot_commands 0 "print scripted bot commands before executing"
set g_debug_defaultsounds 0 "always use default sounds"
set sv_use_csqc_players 0 "set to 1 to network players to CSQC"
+set cl_forceplayermodels 0 "set to 1 to make everyone look like yourself"
// debug cvars for keyhunt attaching
set _angles "0 0 0"
else
self.glowmod = '1 1 1';
- if(self.modelindex != 0 && self.model != "null")
+ if(self.modelindex && self.model != "null")
{
// LOD
if(self.lodmodelindex0 != self.modelindex)
{
- string modelname = self.model; // NOTE: self.model is ALWAYS true model name, self.modelindex may have been rewritten
+ string modelname = self.model;
string s;
// set modelindex
}
}
}
+
+string forceplayermodels_model;
+float forceplayermodels_modelindex;
+float forceplayermodels_skin;
+.string forceplayermodels_savemodel;
+.float forceplayermodels_savemodelindex;
+.float forceplayermodels_saveskin;
+void CSQCModel_Hook_PreUpdate(float isplayer, float islocalplayer)
+{
+ if(isplayer)
+ {
+ // revert to values from server
+ self.model = self.forceplayermodels_savemodel;
+ self.modelindex = self.forceplayermodels_savemodelindex;
+ self.skin = self.forceplayermodels_saveskin;
+ }
+}
+
+void CSQCModel_Hook_PostUpdate(float isplayer, float islocalplayer)
+{
+ if(isplayer)
+ {
+ // save values set by server
+ self.forceplayermodels_savemodel = self.model;
+ self.forceplayermodels_savemodelindex = self.modelindex;
+ self.forceplayermodels_saveskin = self.skin;
+
+ if(autocvar_cl_forceplayermodels)
+ {
+ if(self.modelindex && self.model != "null")
+ {
+ if(islocalplayer)
+ {
+ // trust server's idea of "own player model"
+ forceplayermodels_model = self.model;
+ forceplayermodels_modelindex = self.modelindex;
+ forceplayermodels_skin = self.skin;
+ }
+ if(!forceplayermodels_modelindex)
+ {
+ // only if this failed, find it out on our own
+ setmodel(self, autocvar__cl_playermodel); // this is harmless, see below
+ forceplayermodels_model = self.model;
+ forceplayermodels_modelindex = self.modelindex;
+ forceplayermodels_skin = autocvar__cl_playerskin;
+ }
+ }
+
+ self.model = forceplayermodels_model;
+ self.modelindex = forceplayermodels_modelindex;
+ self.skin = forceplayermodels_skin;
+ }
+ }
+}
// TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack
// add hook function calls here
-#define CSQCMODEL_HOOK_PREUPDATE
-#define CSQCMODEL_HOOK_POSTUPDATE
+#define CSQCMODEL_HOOK_PREUPDATE \
+ CSQCModel_Hook_PreUpdate(isplayer, islocalplayer);
+#define CSQCMODEL_HOOK_POSTUPDATE \
+ CSQCModel_Hook_PostUpdate(isplayer, islocalplayer);
#define CSQCMODEL_HOOK_PREDRAW \
CSQCModel_Hook_PreDraw(isplayer);
#define CSQCPLAYER_HOOK_POSTCAMERASETUP