From 71e190c98c4ba8da1eb6d4cf5e682faff80059e8 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Sat, 8 Aug 2009 13:06:16 +0000 Subject: [PATCH] changeteam & akimbo fixes (thx grenadier) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4608 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/protos.h | 2 +- source/src/server.cpp | 2 ++ source/src/weapon.cpp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/src/protos.h b/source/src/protos.h index 89e8145b..bfe62a2c 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -747,7 +747,7 @@ struct serverconfigfile int filelen; char *buf; serverconfigfile() : filelen(0), buf(NULL) { filename[0] = '\0'; } - ~serverconfigfile() { DELETEA(buf); } + virtual ~serverconfigfile() { DELETEA(buf); } virtual void read() {} void init(const char *name); diff --git a/source/src/server.cpp b/source/src/server.cpp index e22162e1..37bd3e6c 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1506,6 +1506,7 @@ bool updateclientteam(int cln, int newteam, int ftr) } } if(cl.team == newteam && ftr != FTR_AUTOTEAM) return true; // no change + if(cl.team != newteam) sdropflag(cl.clientnum); if(ftr != FTR_INFO && (team_isspect(newteam) || (team_isactive(newteam) && team_isactive(cl.team)))) forcedeath(&cl); sendf(-1, 1, "riii", SV_SETTEAM, cln, newteam | ((ftr == FTR_SILENTFORCE ? FTR_INFO : ftr) << 4)); if(ftr != FTR_INFO && !team_isspect(newteam) && team_isspect(cl.team)) sendspawn(&cl); @@ -2132,6 +2133,7 @@ void sendwelcome(client *cl, int chan) void forcedeath(client *cl) { + sdropflag(cl->clientnum); cl->state.state = CS_DEAD; cl->state.respawn(); sendf(-1, 1, "rii", SV_FORCEDEATH, cl->clientnum); diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index cd8c4658..2155aa9d 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -1226,7 +1226,7 @@ void checkakimbo() if(player1->akimbo) { akimbo &a = *((akimbo *)player1->weapons[GUN_AKIMBO]); - if(a.timerout()) + if(a.timerout() || player1->state == CS_DEAD) { weapon &p = *player1->weapons[GUN_PISTOL]; player1->akimbo = false; @@ -1238,7 +1238,7 @@ void checkakimbo() a.mag = 0; a.ammo = 0; if(player1->weaponsel->type==GUN_AKIMBO) player1->weaponswitch(&p); - audiomgr.playsoundc(S_AKIMBOOUT); + if(player1->state != CS_DEAD) audiomgr.playsoundc(S_AKIMBOOUT); } } }