From 02196de5ade2e3c4c0426e464cba7e7ab2759bdd Mon Sep 17 00:00:00 2001 From: driAn Date: Mon, 10 Nov 2008 19:49:37 +0000 Subject: [PATCH] smooth roll when spec git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3491 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/client.cpp | 2 +- source/src/clients2c.cpp | 2 +- source/src/physics.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index 2a09f07c..56661ddc 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -306,7 +306,7 @@ void c2sinfo(playerent *d) // send update to the server putuint(q, (int)((d->o.z - d->eyeheight)*DMF)); putuint(q, (int)d->yaw); putint(q, (int)d->pitch); - putint(q, (int)d->roll); + putint(q, (int)(125*d->roll/20)); putint(q, (int)(d->vel.x*DVELF)); putint(q, (int)(d->vel.y*DVELF)); putint(q, (int)(d->vel.z*DVELF)); diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 9e5a4147..252276cb 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -76,7 +76,7 @@ void parsepositions(ucharbuf &p) o.z = getuint(p)/DMF; yaw = (float)getuint(p); pitch = (float)getint(p); - roll = (float)getint(p); + roll = (float)(getint(p)*20.0f/125.0f); vel.x = getint(p)/DVELF; vel.y = getint(p)/DVELF; vel.z = getint(p)/DVELF; diff --git a/source/src/physics.cpp b/source/src/physics.cpp index ea24b253..f3567017 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -266,7 +266,7 @@ bool collide(physent *d, bool spawn, float drop, float rise) return true; } -VARP(maxroll, 0, 0, 20); +VARP(maxroll, 0, 0, 20); // note: when changing max value, fix network transmission VAR(recoilbackfade, 0, 100, 1000); void resizephysent(physent *pl, int moveres, int curtime, float min, float max)