]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
csqcmodels: support effects properly
authorRudolf Polzer <divverent@alientrap.org>
Wed, 21 Dec 2011 20:47:25 +0000 (21:47 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 21 Dec 2011 20:47:25 +0000 (21:47 +0100)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/csqcmodel/cl_model.qc
qcsrc/csqcmodel/cl_model.qh
qcsrc/csqcmodel/cl_player.qc
qcsrc/server/cl_client.qc

index 2de97af4dfecbfd010e7eda62c1eba4da389d3d4..d3315d74b2da15378496b7996bc3e22751e98a6b 100644 (file)
@@ -285,10 +285,12 @@ void CSQCModel_Effects_PostUpdate(void)
        self.csqcmodel_modelflags = self.modelflags;
        self.effects = 0;
        self.modelflags = 0;
+       if(self.csqcmodel_teleported)
+               Projectile_ResetTrail(self.origin);
 }
 void CSQCModel_Effects_Apply(void)
 {
-       float eff = self.effects;
+       float eff = self.csqcmodel_effects;
        eff &~= CSQCMODEL_EF_INVISIBLE;
 
        self.renderflags &~= (RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
@@ -336,7 +338,7 @@ void CSQCModel_Effects_Apply(void)
        if(self.csqcmodel_modelflags & MF_ROTATE)
        {
                self.renderflags |= RF_USEAXIS;
-               makevectors(self.angles + '0 0 100' * fmod(time, 3.6));
+               makevectors(self.angles + '0 100 0' * fmod(time, 3.6));
        }
        if(self.csqcmodel_modelflags & MF_TRACER)
                self.traileffect = particleeffectnum("TR_WIZSPIKE");
index 00ff8a8a7fe1eeb98e43fa46c6477062068e1d27..03226613b6afcf7641b99fe55dddd539cb6907c6 100644 (file)
@@ -27,7 +27,6 @@ var float autocvar_cl_nolerp = 0;
 .float csqcmodel_lerpfrac2;
 .float csqcmodel_lerpfractime;
 .float csqcmodel_lerpfrac2time;
-.float csqcmodel_teleported;
 
 void CSQCModel_InterpolateAnimation_PreNote(float sf)
 {
@@ -166,6 +165,9 @@ void CSQCModel_Draw()
                self.renderflags &~= RF_EXTERNALMODEL | RF_VIEWMODEL;
                self.renderflags |= (root.renderflags & (RF_EXTERNALMODEL | RF_VIEWMODEL));
        }
+
+       // we're drawn, now teleporting is over
+       self.csqcmodel_teleported = 0;
 }
 
 void CSQCModel_Read()
index 5b98ae19f9813d5236b9b75b6e9187153369b285..d386565336d0817902d7e19c4fb15328361eb9c5 100644 (file)
@@ -34,3 +34,4 @@ void CSQCModel_Read();
 #undef CSQCMODEL_IF
 
 entity CSQCModel_server2csqc(float pl);
+.float csqcmodel_teleported;
index b79ed6adc49ba1de449ff8ccdd2d23cfa4703e64..9c62bbc5fabcc2e0072b7385d463f2d253eab11c 100644 (file)
@@ -242,10 +242,7 @@ void CSQCPlayer_SetCamera()
                var float refdefflags = 0;
 
                if(view.csqcmodel_teleported)
-               {
                        refdefflags |= REFDEFFLAG_TELEPORTED;
-                       view.csqcmodel_teleported = 0;
-               }
 
                if(input_buttons & 4)
                        refdefflags |= REFDEFFLAG_JUMPING;
index a5d0a22294b40f916b1a816cabcc0a3103a4a960..8489145c12e040b8de7db2dd5bccc014d401b8da 100644 (file)
@@ -1808,7 +1808,7 @@ void player_powerups (void)
                self.modelflags &~= MF_ROCKET;
        }
 
-       self.effects &~= (EF_DIMLIGHT | EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
+       self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
 
        if((self.effects & CSQCMODEL_EF_INVISIBLE) || self.deadflag) // don't apply the flags if the player is gibbed
                return;