changeteam & akimbo fixes (thx grenadier)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4608 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user