covert ops bug


(bacon) #1

There’s a bug in the game with the covert ops. If you get a disguise at the exact moment you die, you will not lose the disguise and will have a wounded model of the player of which you’re disguised as.

There’s an easy way to fix it, in g_combat.c (player_die)
After:

self->client->ps.persistant[PERS_KILLED]++;

Add:

if ( self->client->ps.powerups[PW_OPS_DISGUISED] )
		self->client->ps.powerups[PW_OPS_DISGUISED] = 0;

(mod3m) #2

there was somewhere else that you could spawn as a wounded player. in my first beta of et-mtf we were all spawning wounded :frowning:


(Rain) #3

The problem is actually that the +activate bit that steals the disguise (see Do_Activate2_f) doesn’t check whether you’re dead or not, so you can steal a disguise after you’ve been wounded if you’re close enough.


(Chruker) #4

The code original looks like this:

qboolean Do_Activate2_f(gentity_t *ent, gentity_t *traceEnt) {
	qboolean found = qfalse;

	if( ent->client->sess.playerType == PC_COVERTOPS && !ent->client->ps.powerups[PW_OPS_DISGUISED] ) {
		if( !ent->client->ps.powerups[PW_BLUEFLAG] && !ent->client->ps.powerups[PW_REDFLAG] ) {
			if( traceEnt->s.eType == ET_CORPSE ) {

Adding ’ && ent->health > 0’ to one of those if statements does the trick:

	if( ent->client->sess.playerType == PC_COVERTOPS && !ent->client->ps.powerups[PW_OPS_DISGUISED] && ent->health > 0 ) {