{
// some nice flags for CSQCMODEL_IF and the hooks
float isplayer = (self.entnum >= 1 && self.entnum <= maxclients);
- float islocalplayer = (self.entnum == player_localentnum);
- float isnolocalplayer = (isplayer && (self.entnum != player_localentnum));
+ float islocalplayer = (self.entnum == player_localnum + 1);
+ float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1));
// we don't do this for the local player as that one is already handled
// by CSQCPlayer_SetCamera()
CSQCModel_InterpolateAnimation_Do();
{ CSQCMODEL_HOOK_PREDRAW }
+
+ // inherit draw flags easily
+ entity root = self;
+ while(root.tag_entity)
+ root = root.tag_entity;
+ if(self != root)
+ {
+ self.renderflags &~= RF_EXTERNALMODEL | RF_VIEWMODEL;
+ self.renderflags |= (root.renderflags & (RF_EXTERNALMODEL | RF_VIEWMODEL));
+ }
}
void CSQCModel_Read()
// some nice flags for CSQCMODEL_IF and the hooks
float isplayer = (self.entnum >= 1 && self.entnum <= maxclients);
- float islocalplayer = (self.entnum == player_localentnum);
- float isnolocalplayer = (isplayer && (self.entnum != player_localentnum));
+ float islocalplayer = (self.entnum == player_localnum + 1);
+ float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1));
self.iflags |= IFLAG_ANGLES; // interpolate angles too
// relink
setorigin(self, self.origin);
+ // set obvious render flags
+#ifdef COMPAT_XON050_ENGINE
+ if(self.entnum == player_localentnum || self.entnum == spectatee_status)
+#else
+ if(self.entnum == player_localentnum)
+#endif
+ self.renderflags |= RF_EXTERNALMODEL;
+ else
+ self.renderflags &~= RF_EXTERNALMODEL;
+
// draw it
self.drawmask = MASK_NORMAL;
self.predraw = CSQCModel_Draw;
void CSQCPlayer_Remove()
{
- if(self.entnum != player_localentnum)
+ if(self.entnum != player_localnum + 1)
return;
csqcplayer = world;
cvar_clientsettemp("cl_movement_replay", "1");
float CSQCPlayer_PreUpdate()
{
- if(self.entnum != player_localentnum)
+ if(self.entnum != player_localnum + 1)
return 0;
cvar_clientsettemp("cl_movement_replay", "0");
if(csqcplayer_status != CSQCPLAYERSTATUS_FROMSERVER)
float CSQCPlayer_PostUpdate()
{
- /*
- if(self.entnum == player_localentnum)
- self.renderflags |= RF_EXTERNALMODEL;
- else
- self.renderflags &~= RF_EXTERNALMODEL;
- */
-
if(self.entnum != player_localentnum)
return 0;
csqcplayer_status = CSQCPLAYERSTATUS_FROMSERVER;