mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-18 18:11:22 +00:00
Fixed spec problem when noone is alive. Fixed kicking teammates bug
This commit is contained in:
parent
8bf58f7485
commit
c76ec161e3
3 changed files with 42 additions and 89 deletions
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.41 2002/05/20 16:23:44 jbravo
|
||||||
|
// Fixed spec problem when noone is alive. Fixed kicking teammates bug
|
||||||
|
//
|
||||||
// Revision 1.40 2002/05/20 04:59:33 jbravo
|
// Revision 1.40 2002/05/20 04:59:33 jbravo
|
||||||
// Lots of small fixes.
|
// Lots of small fixes.
|
||||||
//
|
//
|
||||||
|
@ -1347,7 +1350,7 @@ void CG_RQ3_Cmd () {
|
||||||
case SETWEAPON:
|
case SETWEAPON:
|
||||||
i = atoi(CG_Argv(1));
|
i = atoi(CG_Argv(1));
|
||||||
cg.weaponSelect = i;
|
cg.weaponSelect = i;
|
||||||
// cg.snap->ps.stats[STAT_WEAPONS] & ( 1 << i);
|
cg.weaponSelectTime = cg.time;
|
||||||
break;
|
break;
|
||||||
case STUFF:
|
case STUFF:
|
||||||
CG_Stuffcmd();
|
CG_Stuffcmd();
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.95 2002/05/20 16:23:44 jbravo
|
||||||
|
// Fixed spec problem when noone is alive. Fixed kicking teammates bug
|
||||||
|
//
|
||||||
// Revision 1.94 2002/05/20 05:11:56 jbravo
|
// Revision 1.94 2002/05/20 05:11:56 jbravo
|
||||||
// Fixed specmodes when nobody is alive
|
// Fixed specmodes when nobody is alive
|
||||||
//
|
//
|
||||||
|
@ -1068,7 +1071,8 @@ void MakeSpectator(gentity_t *ent)
|
||||||
gclient_t *client;
|
gclient_t *client;
|
||||||
|
|
||||||
client = ent->client;
|
client = ent->client;
|
||||||
CopyToBodyQue (ent);
|
if (ent->s.eType != ET_INVISIBLE)
|
||||||
|
CopyToBodyQue (ent);
|
||||||
|
|
||||||
client->weaponCount[ent->client->ps.weapon] = 0;
|
client->weaponCount[ent->client->ps.weapon] = 0;
|
||||||
client->ps.stats[STAT_WEAPONS] = 0;
|
client->ps.stats[STAT_WEAPONS] = 0;
|
||||||
|
@ -1093,7 +1097,10 @@ void MakeSpectator(gentity_t *ent)
|
||||||
if (OKtoFollow (ent - g_entities)) {
|
if (OKtoFollow (ent - g_entities)) {
|
||||||
client->sess.spectatorState = client->specMode;
|
client->sess.spectatorState = client->specMode;
|
||||||
} else {
|
} else {
|
||||||
|
client->ps.pm_flags &= ~PMF_FOLLOW;
|
||||||
|
client->ps.stats[STAT_RQ3] &= ~RQ3_ZCAM;
|
||||||
client->sess.spectatorState = SPECTATOR_FREE;
|
client->sess.spectatorState = SPECTATOR_FREE;
|
||||||
|
StopFollowing(ent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ClientSpawn(ent);
|
ClientSpawn(ent);
|
||||||
|
@ -1115,7 +1122,7 @@ qboolean OKtoFollow(int clientnum)
|
||||||
if (level.clients[i].sess.sessionTeam == TEAM_SPECTATOR) {
|
if (level.clients[i].sess.sessionTeam == TEAM_SPECTATOR) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_limchasecam.integer != 0 && i != clientnum &&
|
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_limchasecam.integer != 0 &&
|
||||||
level.clients[i].sess.sessionTeam != level.clients[clientnum].sess.savedTeam) {
|
level.clients[i].sess.sessionTeam != level.clients[clientnum].sess.savedTeam) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.58 2002/05/20 16:23:44 jbravo
|
||||||
|
// Fixed spec problem when noone is alive. Fixed kicking teammates bug
|
||||||
|
//
|
||||||
// Revision 1.57 2002/05/18 14:52:16 makro
|
// Revision 1.57 2002/05/18 14:52:16 makro
|
||||||
// Bot stuff. Other stuff. Just... stuff :p
|
// Bot stuff. Other stuff. Just... stuff :p
|
||||||
//
|
//
|
||||||
|
@ -139,25 +142,20 @@ Because it is a weapon!
|
||||||
======================================================================
|
======================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
qboolean JumpKick( gentity_t *ent )
|
qboolean JumpKick (gentity_t *ent) {
|
||||||
{
|
|
||||||
trace_t tr;
|
trace_t tr;
|
||||||
vec3_t end;
|
vec3_t end;
|
||||||
gentity_t *tent;
|
gentity_t *tent, *traceEnt;
|
||||||
gentity_t *traceEnt;
|
int damage;
|
||||||
int damage;
|
|
||||||
//Elder: for kick sound
|
//Elder: for kick sound
|
||||||
qboolean kickSuccess;
|
qboolean kickSuccess;
|
||||||
|
|
||||||
if ( g_gametype.integer == GT_TEAMPLAY && level.lights_camera_action ) {
|
if (g_gametype.integer == GT_TEAMPLAY && level.lights_camera_action) {
|
||||||
return qfalse; // JBravo: No kicking during LCA
|
return qfalse; // JBravo: No kicking during LCA
|
||||||
}
|
}
|
||||||
|
|
||||||
//Makro - added
|
//Makro - added
|
||||||
if ( ent == NULL ) {
|
if (ent == NULL || ent->client == NULL) {
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
if ( ent->client == NULL ) {
|
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,51 +165,32 @@ qboolean JumpKick( gentity_t *ent )
|
||||||
// Elder: AQ2 offset
|
// Elder: AQ2 offset
|
||||||
muzzle[2] -= (ent->client->ps.viewheight - 20);
|
muzzle[2] -= (ent->client->ps.viewheight - 20);
|
||||||
VectorMA (muzzle, 25, forward, end);
|
VectorMA (muzzle, 25, forward, end);
|
||||||
//VectorMA (muzzle, 32, forward, end);
|
|
||||||
|
|
||||||
//VectorCopy( ent->s.origin, muzzle );
|
|
||||||
//muzzle[2] += 32;
|
|
||||||
// the muzzle really isn't the right point to test the jumpkick from
|
// the muzzle really isn't the right point to test the jumpkick from
|
||||||
|
|
||||||
trap_Trace (&tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT);
|
trap_Trace (&tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT);
|
||||||
//trap_Trace (&tr, ent->s.origin, NULL, NULL, end, ent->s.number, MASK_SHOT);
|
|
||||||
|
|
||||||
if ( tr.surfaceFlags & SURF_NOIMPACT ) {
|
if (tr.surfaceFlags & SURF_NOIMPACT) {
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
kickSuccess = DoorKick( &tr, ent, muzzle, forward );
|
kickSuccess = DoorKick (&tr, ent, muzzle, forward);
|
||||||
traceEnt = &g_entities[ tr.entityNum ];
|
traceEnt = &g_entities[tr.entityNum];
|
||||||
|
|
||||||
// JBravo: some sanity checks on the traceEnt
|
// JBravo: some sanity checks on the traceEnt
|
||||||
// Makro - this check made the sound only play when a client is hit
|
// Makro - this check made the sound only play when a client is hit
|
||||||
// if (traceEnt == NULL || traceEnt->client == NULL)
|
|
||||||
if (traceEnt == NULL)
|
if (traceEnt == NULL)
|
||||||
return qfalse;
|
return qfalse;
|
||||||
|
|
||||||
if ( !traceEnt->takedamage) {
|
if (!traceEnt->takedamage)
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
|
||||||
|
|
||||||
//Makro - this was a few lines below
|
//Makro - this was a few lines below
|
||||||
damage = 20;
|
damage = 20;
|
||||||
|
|
||||||
if ( traceEnt->s.eType == ET_BREAKABLE || traceEnt->client)
|
if (traceEnt->s.eType == ET_BREAKABLE || traceEnt->client)
|
||||||
kickSuccess = qtrue;
|
kickSuccess = qtrue;
|
||||||
|
|
||||||
//Elder: can't hit if crouching but can still hit "dead" bodies :)
|
|
||||||
if (traceEnt->client && traceEnt->health > 0 && traceEnt->r.maxs[2] < 20)
|
|
||||||
{
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
|
||||||
damage, DAMAGE_NO_LOCATIONAL, MOD_KICK );
|
|
||||||
if (ent->client && level.team_round_going)
|
|
||||||
ent->client->pers.records[REC_KICKHITS]++;
|
|
||||||
}
|
|
||||||
//end Makro
|
|
||||||
|
|
||||||
// JBravo: no kicking teammates while rounds are going
|
// JBravo: no kicking teammates while rounds are going
|
||||||
if (g_gametype.integer == GT_TEAMPLAY) {
|
if (g_gametype.integer == GT_TEAMPLAY) {
|
||||||
//Makro - client check here
|
//Makro - client check here
|
||||||
|
@ -222,6 +201,15 @@ qboolean JumpKick( gentity_t *ent )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Elder: can't hit if crouching but can still hit "dead" bodies :)
|
||||||
|
if (traceEnt->client && traceEnt->health > 0 && traceEnt->r.maxs[2] < 20) {
|
||||||
|
return qfalse;
|
||||||
|
} else {
|
||||||
|
G_Damage (traceEnt, ent, ent, forward, tr.endpos, damage, DAMAGE_NO_LOCATIONAL, MOD_KICK);
|
||||||
|
if (ent->client && level.team_round_going)
|
||||||
|
ent->client->pers.records[REC_KICKHITS]++;
|
||||||
|
}
|
||||||
|
//end Makro
|
||||||
|
|
||||||
//Makro - client check
|
//Makro - client check
|
||||||
if (ent->client) {
|
if (ent->client) {
|
||||||
|
@ -235,31 +223,17 @@ qboolean JumpKick( gentity_t *ent )
|
||||||
|
|
||||||
//Makro - moved some code up by a few lines to allow breakables to be kicked
|
//Makro - moved some code up by a few lines to allow breakables to be kicked
|
||||||
|
|
||||||
// send blood impact + event stuff
|
if (traceEnt->client != NULL && traceEnt->takedamage) {
|
||||||
/*
|
tent = G_TempEntity (tr.endpos, EV_JUMPKICK);
|
||||||
if ( traceEnt->takedamage && traceEnt->client ) {
|
|
||||||
//tent = G_TempEntity( tr.endpos, EV_MISSILE_HIT );
|
|
||||||
tent = G_TempEntity( tr.endpos, EV_JUMPKICK );
|
|
||||||
tent->s.otherEntityNum = traceEnt->s.number;
|
|
||||||
tent->s.eventParm = DirToByte( tr.plane.normal );
|
|
||||||
tent->s.weapon = ent->s.weapon;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (traceEnt->client != NULL && traceEnt->takedamage)
|
|
||||||
{
|
|
||||||
tent = G_TempEntity( tr.endpos, EV_JUMPKICK );
|
|
||||||
tent->s.otherEntityNum = traceEnt->s.number;
|
tent->s.otherEntityNum = traceEnt->s.number;
|
||||||
tent->s.otherEntityNum2 = ent->s.number;
|
tent->s.otherEntityNum2 = ent->s.number;
|
||||||
tent->s.eventParm = DirToByte( tr.plane.normal );
|
tent->s.eventParm = DirToByte (tr.plane.normal);
|
||||||
tent->s.weapon = 0;
|
tent->s.weapon = 0;
|
||||||
|
|
||||||
|
if (traceEnt->client->uniqueWeapons > 0) {
|
||||||
if (traceEnt->client->uniqueWeapons > 0)
|
|
||||||
{
|
|
||||||
//Elder: toss a unique weapon if kicked
|
//Elder: toss a unique weapon if kicked
|
||||||
//Need to make sure to cancel any reload attempts - test this
|
//Need to make sure to cancel any reload attempts - test this
|
||||||
Cmd_Unzoom(traceEnt);
|
Cmd_Unzoom (traceEnt);
|
||||||
traceEnt->client->fastReloads = 0;
|
traceEnt->client->fastReloads = 0;
|
||||||
traceEnt->client->reloadAttempts = 0;
|
traceEnt->client->reloadAttempts = 0;
|
||||||
traceEnt->client->ps.weaponTime = 0;
|
traceEnt->client->ps.weaponTime = 0;
|
||||||
|
@ -272,40 +246,9 @@ qboolean JumpKick( gentity_t *ent )
|
||||||
kickSuccess = qfalse;
|
kickSuccess = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Elder: for the kick
|
|
||||||
// do our special form of knockback here
|
|
||||||
/*
|
|
||||||
VectorMA (self->enemy->absmin, 0.5, self->enemy->size, v);
|
|
||||||
VectorSubtract (v, point, v);
|
|
||||||
VectorNormalize (v);
|
|
||||||
VectorMA (self->enemy->velocity, kick, v, self->enemy->velocity);
|
|
||||||
if (self->enemy->velocity[2] > 0)
|
|
||||||
self->enemy->groundentity = NULL;
|
|
||||||
*/
|
|
||||||
//Elder: kick knockback for AQ2 -- recall variable kick = 400
|
|
||||||
//if (traceEnt->client)
|
|
||||||
//{
|
|
||||||
//Elder: for kick knockback
|
|
||||||
//vec3_t size, vTemp;
|
|
||||||
|
|
||||||
//Make the "size" vector - hopefully this is right
|
|
||||||
//VectorSubtract(traceEnt->r.maxs, traceEnt->r.mins, size);
|
|
||||||
//G_Printf("Size: %s\n", vtos(size));
|
|
||||||
|
|
||||||
//VectorMA(traceEnt->r.absmin, 0.5, size, vTemp);
|
|
||||||
//VectorSubtract(vTemp, tr.endpos, vTemp);
|
|
||||||
//VectorNormalize(vTemp);
|
|
||||||
//VectorMA(traceEnt->client->ps.velocity, 400, vTemp, traceEnt->client->ps.velocity);
|
|
||||||
//if (traceEnt->client->ps.velocity[2] > 0)
|
|
||||||
//traceEnt->s.groundEntityNum = ENTITYNUM_NONE;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//Elder: Our set of locally called sounds
|
//Elder: Our set of locally called sounds
|
||||||
if (kickSuccess)
|
if (kickSuccess) {
|
||||||
{
|
G_AddEvent (ent, EV_RQ3_SOUND, RQ3_SOUND_KICK);
|
||||||
G_AddEvent ( ent, EV_RQ3_SOUND, RQ3_SOUND_KICK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return qtrue;
|
return qtrue;
|
||||||
|
|
Loading…
Reference in a new issue