//vector PL_CROUCH_MIN = ...;
//vector PL_CROUCH_MAX = ...;
//vector PL_CROUCH_VIEW_OFS = ...;
+
+#ifdef SVQC
+# ifdef NO_LEGACY_NETWORKING
+# define CSQCMODEL_AUTOINIT() CSQCModel_LinkEntity()
+# define CSQCMODEL_AUTOUPDATE() CSQCModel_CheckUpdate()
+# else
+.float iscsqcmodel;
+float autocvar_sv_use_csqc_players;
+# define CSQCMODEL_AUTOINIT() \
+ if(autocvar_sv_use_csqc_players) \
+ { \
+ CSQCModel_LinkEntity(); \
+ self.iscsqcmodel = 1; \
+ }
+# define CSQCMODEL_AUTOUPDATE() \
+ if(autocvar_sv_use_csqc_players && !self.iscsqcmodel) \
+ { \
+ CSQCModel_LinkEntity(); \
+ self.iscsqcmodel = 1; \
+ } \
+ if(!autocvar_sv_use_csqc_players && self.iscsqcmodel) \
+ { \
+ CSQCModel_UnlinkEntity(); \
+ self.iscsqcmodel = 0; \
+ } \
+ if(self.iscsqcmodel) \
+ CSQCModel_CheckUpdate();
+# endif
+#endif
float autocvar_g_trueaim_minrange;
float autocvar_g_debug_defaultsounds;
float autocvar_g_loituma;
-#ifndef NO_LEGACY_NETWORKING
-float autocvar_sv_use_csqc_players;
-#endif
return 0;
}
-#ifndef NO_LEGACY_NETWORKING
-.float iscsqcmodel;
-#endif
-
/*
=============
ClientConnect
if(!autocvar_g_campaign)
Send_CSQC_Centerprint_Generic(self, CPID_MOTD, getwelcomemessage(), autocvar_welcome_message_time, 0);
-#ifndef NO_LEGACY_NETWORKING
- if(autocvar_sv_use_csqc_players)
- {
- CSQCModel_LinkEntity();
- self.iscsqcmodel = 1;
- }
-#else
- CSQCModel_LinkEntity();
-#endif
+ CSQCMODEL_AUTOINIT();
self.model_randomizer = random();
}
dprint(sprintf("%f %.6f\n", time, race_GetFractionalLapCount(self)));
*/
-#ifndef NO_LEGACY_NETWORKING
- if(autocvar_sv_use_csqc_players && !self.iscsqcmodel)
- {
- CSQCModel_LinkEntity();
- self.iscsqcmodel = 1;
- }
-
- if(!autocvar_sv_use_csqc_players && self.iscsqcmodel)
- {
- CSQCModel_UnlinkEntity();
- self.iscsqcmodel = 0;
- }
-
- if(self.iscsqcmodel)
- CSQCModel_CheckUpdate();
-#else
- CSQCModel_CheckUpdate();
-#endif
+ CSQCMODEL_AUTOUPDATE();
}
self.glowmod = self.owner.weaponentity_glowmod;
self.colormap = self.owner.colormap;
+
+ CSQCMODEL_AUTOUPDATE();
}
// spawning weaponentity for client
self.exteriorweaponentity.angles = '0 0 0';
self.exteriorweaponentity.think = CL_ExteriorWeaponentity_Think;
self.exteriorweaponentity.nextthink = time;
+
+ {
+ entity oldself = self;
+ self = self.exteriorweaponentity;
+ CSQCMODEL_AUTOINIT();
+ self = oldself;
+ }
}
void Send_WeaponComplain (entity e, float wpn, string wpnname, float type)