View Single Post
Old 03-09-2006, 06:04 AM   #75
Slider744
Junior Member
 
Slider744's Avatar
 
Join Date: Dec 2003
Location: France
Posts: 260
i Just fixed a few things one week ago for JA+ mod...
here is my code for the fixes...


invisibility vehicle driver bug FIX
It allows a player riding a vehicle inside (like atst) to become invisible by reconnecting the server while beeing inside.

add this at the end of ClientSpawn(gentity_t *ent) in g_client.c
Code:
//MODIFICATION => FIX the basejka bug when players are invisible after having reconnecting when beeing inside a vehicle with hideRider 1
	
	ent->r.svFlags &= ~SVF_NOCLIENT;
	ent->s.eFlags &= ~EF_NODRAW;
	if ( ent->client )
	{
		ent->client->ps.eFlags &= ~EF_NODRAW;
	}

unlock door exploit FIX
I only fixed it for siege gametype. i don't know if it usefull for other gametype at the moment. Moreover this things seen as a bug in siege mod could be usefull in other gametype for mappers.
we need to prevent a blocked door to be unlock because it might screw up siege objectives

in g_mover.c
change this
Code:
/*
================
Blocked_Door
================
*/
void Blocked_Door( gentity_t *ent, gentity_t *other )
{
	if ( ent->damage ) {
		G_Damage( other, ent, ent, NULL, NULL, ent->damage, 0, MOD_CRUSH );
	}
	if ( ent->spawnflags & MOVER_CRUSHER ) {
		return;		// crushers don't reverse
	}


	// reverse direction
	Use_BinaryMover( ent, ent, other );
}
with this

Code:
/*
================
MODIFICATION added this special function for blocked door to prevent unlock in siege.
I didn't want tthis fix to work in other gametype than siege at the moment.
Use_BinaryMover_blockedDoor
================
*/
void Use_BinaryMover_blockedDoor( gentity_t *ent, gentity_t *other, gentity_t *activator ) 
{
	if ( !ent->use )
	{//I cannot be used anymore, must be a door with a wait of -1 that's opened.
		return;
	}

	// only the master should be used
	if ( ent->flags & FL_TEAMSLAVE ) 
	{
		Use_BinaryMover_blockedDoor( ent->teammaster, other, activator );
		return;
	}

	if ( ent->flags & FL_INACTIVE )
	{
		return;
	}

	if ( ent->spawnflags & MOVER_LOCKED )
	{//a locked door
		return;
	}

	G_ActivateBehavior(ent,BSET_USE);

	ent->enemy = other;
	ent->activator = activator;
	if(ent->delay)
	{
		ent->think = Use_BinaryMover_Go;
		ent->nextthink = level.time + ent->delay;
	}
	else
	{
		Use_BinaryMover_Go(ent);
	}
}

/*
================
Blocked_Door
================
*/
void Blocked_Door( gentity_t *ent, gentity_t *other )
{
	if ( ent->damage ) {
		G_Damage( other, ent, ent, NULL, NULL, ent->damage, 0, MOD_CRUSH );
	}
	if ( ent->spawnflags & MOVER_CRUSHER ) {
		return;		// crushers don't reverse
	}

	//MODIFICATION FIX only for SIEGE => each time there is something under a door like a player, or det pack ... the door will reopen and will be unlocked
	// so player can lame siege gametype where some doors are locked and unlocked only if some objectives are completed.
	//Use_BinaryMover will unlock the MOVER entity like a doors or teammaster (for group mover items) ==> it needs to be prevent.
	
	// we need to prevent a blocked door to be unlock but only in siege at the moment. i don't know if it usefull for other gametype at the moment. Moreover this things seen as a bug in siege mod could be usefull in other gametype for mappers.
	if(g_gametype.integer == GT_SIEGE){
		
		Use_BinaryMover_blockedDoor( ent, ent, other );
		return;
	
	}

	// reverse direction
	Use_BinaryMover( ent, ent, other );
}


DetPAck exploit FIX
This exploit allows player to kill teamates or destroy siege team objectives that they should protect from the other teams.
To use this exploit you have to fire some det packs and then going to spectator or disconnecting the server while the detpack are not exploding yet...
DOing that all the det pack will explode and kill teamates or team objectives...etc...

in g_combat.c
add in G_Damage
after
Code:
	if (targ->flags & FL_BBRUSH)
	{
		if (mod == MOD_DEMP2 ||
			mod == MOD_DEMP2_ALT ||
			mod == MOD_BRYAR_PISTOL ||
			mod == MOD_BRYAR_PISTOL_ALT ||
			mod == MOD_MELEE)
		{ //these don't damage bbrushes.. ever
			if ( mod != MOD_MELEE || !G_HeavyMelee( attacker ) )
			{ //let classes with heavy melee ability damage breakable brushes with fists
				return;
			}
		}
	}
add this
Code:
	//MODIFICATION FIX : to prevent detpack to blow teamate members and teamate siege objectives when the attacker is switching to spectator or disconnect the server
	if(mod == MOD_DET_PACK_SPLASH && ! (attacker && attacker->inuse && attacker->client && attacker->client->pers.connected == CON_CONNECTED ) )
		return;
         if(mod == MOD_DET_PACK_SPLASH && attacker && attacker->inuse && attacker->client && attacker->client->pers.connected == CON_CONNECTED
		&& 
			(	attacker->client->sess.sessionTeam == TEAM_SPECTATOR 
				|| 
				( g_gametype.integer == GT_SIEGE && attacker->client->sess.siegeDesiredTeam == TEAM_SPECTATOR)
			)		
	)
		return;


******************************
Slider
JA+ MOD Author for Jedi Academy
the lastest version on

http://www.japlus.net/


******************************

Last edited by Slider744; 03-26-2006 at 01:45 PM.
Slider744 is offline   you may: quote & reply,