]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Adjust jump pad velocity on Q3 maps to match 125fps frametime-dependent behaviour
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 7 Feb 2023 05:20:41 +0000 (15:20 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 7 Feb 2023 05:20:41 +0000 (15:20 +1000)
qcsrc/common/mapobjects/trigger/jumppads.qc

index eee980618d8b2b47341963aeed3e34b54556ba6d..72d9916d1e9a4e1656c8e872776b3eab19e18e28 100644 (file)
@@ -39,6 +39,13 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity p
        if(pushed_entity && pushed_entity.gravity)
                grav *= pushed_entity.gravity;
 
+       // Q3 has frametime-dependent gravity, but its trigger_push velocity calculation doesn't account for that.
+       // This discrepancy can be simulated accurately with a multiplier which here ensures that
+       // all entities will arrive where they would in Q3 at 125fps, even if entity-specific gravity is applied.
+       // See physicsCPMA.cfg for the source of the magic number.
+       if (STAT(Q3COMPAT, pushed_entity) && GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE)
+               grav *= 1.056530513;
+
        zdist = torg.z - org.z;
        sdist = vlen(torg - org - zdist * '0 0 1');
        sdir = normalize(torg - org - zdist * '0 0 1');