]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
force about 4 origin sends per player per frame "to make sure" (to better handle...
authorRudolf Polzer <divverent@alientrap.org>
Tue, 20 Dec 2011 21:57:00 +0000 (22:57 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 20 Dec 2011 21:58:40 +0000 (22:58 +0100)
qcsrc/csqcmodel/settings.qh
qcsrc/csqcmodel/sv_model.qc

index a687dfb909e6678a04e2bed669519fdaad3ebad4..257676db734871712ae812bf9d95ca4b0bc02130 100644 (file)
@@ -40,6 +40,8 @@
        CSQCModel_Hook_PreDraw(isplayer, islocalplayer);
 #define CSQCPLAYER_HOOK_POSTCAMERASETUP
 
+#define CSQCPLAYER_FORCE_UPDATES 0.25
+
 // mod must define:
 //vector PL_MIN  = ...;
 //vector PL_MAX  = ...;
index 164c5477367b890f631885e7be3765d5b650a2fc..1c214e0aba78780aabf153c2437966ca0c20b848 100644 (file)
@@ -49,6 +49,9 @@ float CSQCModel_Send(entity to, float sf)
        return TRUE;
 }
 
+#ifdef CSQCPLAYER_FORCE_UPDATES
+.float csqcmodel_nextforcedupdate;
+#endif
 void CSQCModel_CheckUpdate()
 {
        // some nice flags for CSQCMODEL_IF
@@ -56,6 +59,14 @@ void CSQCModel_CheckUpdate()
        float islocalplayer = isplayer; // we set BOTH to 1 here as we need the sendflags
        float isnolocalplayer = isplayer; // we set BOTH to 1 here as we need the sendflags
 
+#ifdef CSQCPLAYER_FORCE_UPDATES
+       if(isplayer && time > self.csqcmodel_nextforcedupdate)
+       {
+               self.SendFlags |= CSQCMODEL_PROPERTY_ORIGIN;
+               self.csqcmodel_nextforcedupdate = time + CSQCPLAYER_FORCE_UPDATES * (0.5 + random()); // ensure about 4 origin sends per sec
+       }
+#endif
+
        if(self.effects & EF_RESTARTANIM_BIT)
        {
                self.SendFlags |= CSQCMODEL_PROPERTY_FRAME | CSQCMODEL_PROPERTY_FRAME2; // full anim resend please