Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Unofficial Quake III Arena gamecode patch
* fixed shotgun not gibbing unless aiming at the feet
* fixed server browser + faster scanning
* fixed grappling hook muzzle position visuals
* migrated STAT_DEAD_YAW logic to player_state->damagePitch and player_state->damageYaw to sum the result, now it's renamed as STAT_UNUSED_INDEX and it can be reused even if you want to retain the demo networking in this same enum value field.
* new demo UI (subfolders,filtering,sorting)
* updated serverinfo UI
* map rotation system
Expand Down
7 changes: 4 additions & 3 deletions code/cgame/cg_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ static void CG_OffsetThirdPersonView( void ) {

// if dead, look at killer
if ( cg.predictedPlayerState.stats[STAT_HEALTH] <= 0 ) {
focusAngles[YAW] = cg.predictedPlayerState.stats[STAT_DEAD_YAW];
cg.refdefViewAngles[YAW] = cg.predictedPlayerState.stats[STAT_DEAD_YAW];
int totalYaw = cg.predictedPlayerState.damageYaw + cg.predictedPlayerState.damagePitch;
focusAngles[YAW] = totalYaw;
cg.refdefViewAngles[YAW] = totalYaw;
}

if ( focusAngles[PITCH] > 45 ) {
Expand Down Expand Up @@ -311,7 +312,7 @@ static void CG_OffsetFirstPersonView( void ) {
if ( cg.snap->ps.stats[STAT_HEALTH] <= 0 ) {
angles[ROLL] = 40;
angles[PITCH] = -15;
angles[YAW] = cg.snap->ps.stats[STAT_DEAD_YAW];
angles[YAW] = cg.snap->ps.damageYaw + cg.snap->ps.damagePitch;
origin[2] += cg.predictedPlayerState.viewheight;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion code/game/bg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ typedef enum {
#endif
STAT_WEAPONS, // 16 bit fields
STAT_ARMOR,
STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?)
STAT_UNUSED_INDEX, // unused stat index (don't remove if you want to keep demo networking!)
STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?)
STAT_MAX_HEALTH // health / armor limit, changable by handicap
} statIndex_t;
Expand Down
18 changes: 16 additions & 2 deletions code/game/g_combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,31 @@ LookAtKiller
*/
void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker ) {
vec3_t dir;
float killerYaw = self->s.angles[YAW];

if ( attacker && attacker != self ) {
VectorSubtract (attacker->s.pos.trBase, self->s.pos.trBase, dir);
} else if ( inflictor && inflictor != self ) {
VectorSubtract (inflictor->s.pos.trBase, self->s.pos.trBase, dir);
} else {
self->client->ps.stats[STAT_DEAD_YAW] = self->s.angles[YAW];
if ( killerYaw > 255 ) {
self->client->ps.damageYaw = 255;
self->client->ps.damagePitch = (int)( killerYaw - 255 );
} else {
self->client->ps.damageYaw = (int)killerYaw;
self->client->ps.damagePitch = 0;
}
return;
}

self->client->ps.stats[STAT_DEAD_YAW] = vectoyaw ( dir );
killerYaw = vectoyaw ( dir );
if ( killerYaw > 255 ) {
self->client->ps.damageYaw = 255;
self->client->ps.damagePitch = (int)( killerYaw - 255 );
} else {
self->client->ps.damageYaw = (int)killerYaw;
self->client->ps.damagePitch = 0;
}
}

/*
Expand Down