]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
items: use a different CSQC physics code path for smoother motion
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 11 Jun 2023 20:25:14 +0000 (06:25 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 15 Jun 2023 20:36:23 +0000 (06:36 +1000)
Previously it ran physics in whole numbers of server frametimes, which
would cause "jumps" when the updates for a thrown item arrived.

qcsrc/client/items/items.qc

index 740294b2c1795d4020bed21dce372a1114bd5f25..b7c1b8de08efd206771b6d6211e04455f7f0fdc6 100644 (file)
@@ -42,7 +42,7 @@ void ItemDraw(entity this)
                // which requires running this even if the item is just outside visible range (it could be moving into range)
                if(animate)
                        bobheight = this.origin_z - this.oldorigin_z;
-               Movetype_Physics_MatchServer(this, false);
+               Movetype_Physics_NoMatchTicrate(this, frametime, true);
                this.oldorigin = this.origin; // update real (SVQC equivalent) origin
                if(animate)
                {
@@ -256,14 +256,6 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
                //this.angles = '0 0 0';
                set_movetype(this, MOVETYPE_TOSS);
                this.velocity = ReadVector();
-
-               if(!this.move_time)
-               {
-                       this.move_time = time;
-                       this.spawntime = time;
-               }
-               else
-                       this.move_time = max(this.move_time, time);
        }
 
        this.entremove = ItemRemove;