From db9bd67be925f4e33821fbaf50be2f7ae8885d12 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Wed, 10 Feb 2016 15:50:38 +0100 Subject: [PATCH] protocol bump no longer compatible with 1.2.0.2 also: nade effect quantisation fixed --- source/src/clients2c.cpp | 6 +++--- source/src/protocol.h | 2 +- source/src/tools.cpp | 2 +- source/src/weapon.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 821abc54..fcdb6e21 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -726,9 +726,9 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false) case SV_THROWNADE: { - vec from, to; + vec from, vel; loopk(3) from[k] = getint(p)/DMF; - loopk(3) to[k] = getint(p)/DMF; + loopk(3) vel[k] = getint(p)/DNF; int nademillis = getint(p); if(!d) break; d->lastaction = lastmillis; @@ -736,7 +736,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false) d->lastattackweapon = d->weapons[GUN_GRENADE]; if(d->weapons[GUN_GRENADE]) { - d->weapons[GUN_GRENADE]->attackfx(from, to, nademillis); + d->weapons[GUN_GRENADE]->attackfx(from, vel, nademillis); d->weapons[GUN_GRENADE]->reloading = 0; } if(d!=player1) d->pstatshots[GUN_GRENADE]++; //NEW diff --git a/source/src/protocol.h b/source/src/protocol.h index fd30d6a7..ab07823b 100644 --- a/source/src/protocol.h +++ b/source/src/protocol.h @@ -5,7 +5,7 @@ #define CUBE_SERVINFO_PORT_LAN 28762 #define CUBE_SERVINFO_PORT(serverport) (serverport+1) #define CUBE_SERVINFO_TO_SERV_PORT(servinfoport) (servinfoport-1) -#define PROTOCOL_VERSION 1201 // bump when protocol changes (use negative numbers for mods!) +#define PROTOCOL_VERSION 1203 // bump when protocol changes (use negative numbers for mods!) #define DEMO_VERSION 2 // bump when demo format changes #define DEMO_MAGIC "ASSAULTCUBE_DEMO" #define DEMO_MINTIME 10000 // don't keep demo recordings with less than 10 seconds diff --git a/source/src/tools.cpp b/source/src/tools.cpp index a8732def..928a4afc 100644 --- a/source/src/tools.cpp +++ b/source/src/tools.cpp @@ -15,7 +15,7 @@ char *strtok_r(char *s, const char *delim, char **b) } #endif -string _timestringbuffer; +string _timestringbuffer = ""; const char *timestring(time_t t, bool local, const char *fmt, char *buf) { diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 633d675c..f65bace0 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -1175,7 +1175,7 @@ void grenadeent::_throw(const vec &from, const vec &vel) inwater = waterlevel > o.z; if(local) { - addmsg(SV_THROWNADE, "ri7", int(o.x*DMF), int(o.y*DMF), int(o.z*DMF), int(vel.x*DMF), int(vel.y*DMF), int(vel.z*DMF), lastmillis-millis); + addmsg(SV_THROWNADE, "ri7", int(o.x*DMF), int(o.y*DMF), int(o.z*DMF), int(vel.x*DNF), int(vel.y*DNF), int(vel.z*DNF), lastmillis-millis); audiomgr.playsound(S_GRENADETHROW, SP_HIGH); } else audiomgr.playsound(S_GRENADETHROW, owner);