self.ivelocity2 = self.velocity;
}
- if(vlen(self.iorigin2 - self.iorigin1) > 1000)
+ if(self.iflags & IFLAG_TELEPORTED)
{
+ self.iflags &~= IFLAG_TELEPORTED;
self.itime1 = self.itime2 = time; // don't lerp
}
-
- if((self.iflags & IFLAG_VELOCITY) && (vlen(self.ivelocity2 - self.ivelocity1) > 1000))
+ else if(vlen(self.iorigin2 - self.iorigin1) > 1000)
{
self.itime1 = self.itime2 = time; // don't lerp
}
-
- if(dt < 0.2)
+ else if((self.iflags & IFLAG_VELOCITY) && (vlen(self.ivelocity2 - self.ivelocity1) > 1000))
{
- self.itime1 = serverprevtime;
- self.itime2 = time;
+ self.itime1 = self.itime2 = time; // don't lerp
}
- else
+ else if(dt >= 0.2)
{
- // don't lerp
self.itime1 = self.itime2 = time;
}
+ else
+ {
+ self.itime1 = serverprevtime;
+ self.itime2 = time;
+ }
}
void InterpolateOrigin_Do()
{
#define IFLAG_AUTOANGLES 4
#define IFLAG_VALID 8
#define IFLAG_PREVALID 16
+#define IFLAG_TELEPORTED 32
#define IFLAG_INTERNALMASK (IFLAG_VALID | IFLAG_PREVALID)
// call this BEFORE reading an entity update
ALLPROPERTIES
#undef PROPERTY_SCALED
#undef PROPERTY
+
+ if(sf & PROPERTY_TELEPORTED)
+ self.iflags |= IFLAG_TELEPORTED;
CSQCModel_InterpolateAnimation_Note(sf);
InterpolateOrigin_Note();
#define PROPERTY_FRAME 32768
#define PROPERTY_FRAME2 16384
#define PROPERTY_LERPFRAC 8192
+#define PROPERTY_TELEPORTED 4096 // the "teleport bit" cancelling interpolation
#define ALLPROPERTIES_COMMON \
PROPERTY(PROPERTY_FRAME, ReadByte, WriteByte, frame) \
self.effects &~= EF_RESTARTANIM_BIT;
}
+ if(self.effects & EF_TELEPORT_BIT)
+ {
+ self.SendFlags |= PROPERTY_TELEPORTED; // no interpolation please
+ self.effects &~= EF_TELEPORT_BIT;
+ }
+
#define PROPERTY(flag,r,w,f) \
tmp = self.f; \
if(tmp != self.csqcmodel_##f) \