From d5c4c91fc611f1ce5a38928613c742ce99fd92d3 Mon Sep 17 00:00:00 2001 From: driAn Date: Thu, 16 Mar 2006 20:12:29 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@226 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clients2c.cpp | 3 ++- source/src/weapon.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 738dce1e..a7aab9b8 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -183,7 +183,8 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th e.y = getint(p)/DMF; e.z = getint(p)/DMF; if(gun==GUN_SHOTGUN) createrays(s, e); - int nademillis = getint(p)*100; + int nademillis = 2000/100*getint(p); + if(nademillis<0 || nademillis>100) nademillis = 100; printf("nadesec: %i\n", nademillis); shootv(gun, s, e, d, nademillis); break; diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index cd1b2fc2..194d3c82 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -330,7 +330,9 @@ void throw_nade(dynent *d, vec &to, physent *p) if(d==player1) { - addmsg(1, 9, SV_SHOT, d->gunselect, (int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF), (int)(to.x*DMF), (int)(to.y*DMF), (int)(to.z*DMF), (int)((lastmillis-p->millis)/100)); + int percent_done = (lastmillis-p->millis)*100/2000; + if(percent_done < 0 || percent_done > 100) percent_done = 100; + addmsg(1, 9, SV_SHOT, d->gunselect, (int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF), (int)(to.x*DMF), (int)(to.y*DMF), (int)(to.z*DMF), percent_done); printf("grenade: %i\n", (lastmillis-curnade->millis)/100); if(curnade) curnade = NULL; };