]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed bug where dpmod weapons fired twice as often as intended (frametime is now...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Apr 2007 08:47:17 +0000 (08:47 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Apr 2007 08:47:17 +0000 (08:47 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7054 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index 0dd67604e60bad370824eed14d044ab9fcdf5cf5..08e8aea87c51fee46e55efb034e4b8fb78276669 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -2004,13 +2004,16 @@ void SV_Physics_ClientMove(void)
        prvm_edict_t *ent;
        ent = host_client->edict;
 
-       // call player physics
+       // call player physics, this needs the proper frametime
+       prog->globals.server->frametime = sv.frametime;
        SV_ClientThink();
 
-       // call standard client pre-think
+       // call standard client pre-think, with frametime = 0
        prog->globals.server->time = sv.time;
+       prog->globals.server->frametime = 0;
        prog->globals.server->self = PRVM_EDICT_TO_PROG(ent);
        PRVM_ExecuteProgram (prog->globals.server->PlayerPreThink, "QC function PlayerPreThink is missing");
+       prog->globals.server->frametime = sv.frametime;
 
        // make sure the velocity is sane (not a NaN)
        SV_CheckVelocity(ent);
@@ -2033,10 +2036,12 @@ void SV_Physics_ClientMove(void)
 
        SV_CheckVelocity (ent);
 
-       // call standard player post-think
+       // call standard player post-think, with frametime = 0
        prog->globals.server->time = sv.time;
+       prog->globals.server->frametime = 0;
        prog->globals.server->self = PRVM_EDICT_TO_PROG(ent);
        PRVM_ExecuteProgram (prog->globals.server->PlayerPostThink, "QC function PlayerPostThink is missing");
+       prog->globals.server->frametime = sv.frametime;
 
        if(ent->fields.server->fixangle)
        {