PDA

View Full Version : Jedi Master


ensiform
03-04-2006, 10:32 PM
I've noticed when you kick the jedi master or they disco it doesnt exactly drop the saber and return it so i figured it needs the same code as when they suicide in ClientDisconnect:

if ( g_gametype.integer == GT_JEDIMASTER ) {
if ( ent->client->ps.isJediMaster )
{ //killed ourself so return the saber to the original position
//(to avoid people jumping off ledges and making the saber
//unreachable for 60 seconds)
ThrowSaberToAttacker(ent, NULL);
ent->client->ps.isJediMaster = qfalse;
}
}

i stuck that just below the part about stop following in clientdisconnect.

ensiform
03-04-2006, 10:38 PM
i also noticed bots dont attempt to shoot people when there is no master yet the other functions seem to say they can but PassStandardEnemyChecks doesnt check it.

so..

move the declaration of qboolean G_ThereIsAMaster(void); above PassStandardEnemyChecks and change the jedi master part of it in that function (ai_main.c) to this:

if (g_gametype.integer == GT_JEDIMASTER && !en->client->ps.isJediMaster && !bs->cur_ps.isJediMaster && G_ThereIsAMaster())
{ //rules for attacking non-JM in JM mode
vec3_t vs;
float vLen = 0;

if (!g_friendlyFire.integer)
{ //can't harm non-JM in JM mode if FF is off
return 0;
}

VectorSubtract(bs->origin, en->client->ps.origin, vs);
vLen = VectorLength(vs);

if (vLen > 350)
{
return 0;
}
}

razorace
03-04-2006, 11:13 PM
I've noticed when you kick the jedi master or they disco it doesnt exactly drop the saber and return it so i figured it needs the same code as when they suicide in ClientDisconnect:
I thought the JM saber think function handled that by just respawning?

razorace
03-04-2006, 11:21 PM
Also, thanks for the JM fix. I'll add it to the code now.