Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA/WIPEOUT: bug fixes and improvements #327

Merged
merged 3 commits into from
Dec 11, 2023
Merged
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
8 changes: 5 additions & 3 deletions src/clan_arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ void CA_SendTeamInfo(gedict_t *t)
int kills;
int deaths;
int max_deaths;
int track_target;
gedict_t *p, *s;
char *tm, *nick;

Expand Down Expand Up @@ -751,10 +752,11 @@ void CA_SendTeamInfo(gedict_t *t)

kills = bound(0, (int)p->round_kills, 999);
deaths = bound(0, (int)p->round_deaths, 999);
track_target = p->track_target ? NUM_FOR_EDICT(p->track_target) : -1;

stuffcmd(t, "//cainfo %d %d %d %d %d %d %d \"%s\" %d %d %d %d %d %d %d %d %d\n", cl,
stuffcmd(t, "//cainfo %d %d %d %d %d %d %d \"%s\" %d %d %d %d %d %d %d %d %d %d\n", cl,
origin0, origin1, origin2, h, a, items, nick, shells, nails, rockets, cells,
camode, deadtype, timetospawn, kills, deaths);
camode, deadtype, timetospawn, kills, deaths, track_target);
}
}

Expand Down Expand Up @@ -1277,7 +1279,7 @@ void CA_player_pre_think(void)

// take no damage to health/armor withing 1 second of respawn
// or during endround
if (((self->alive_time >= 1) || !self->round_deaths) && !ca_round_pause)
if (self->in_play && ((self->alive_time >= 1) || !self->round_deaths) && !ca_round_pause)
{
self->no_pain = false;
}
Expand Down
19 changes: 16 additions & 3 deletions src/combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,23 @@ void T_Damage(gedict_t *targ, gedict_t *inflictor, gedict_t *attacker, float dam
}
}

// don't accept any damage in CA modes if no_pain is true (ie during respawn in wipeout)
// don't accept any damage in CA modes if no_pain is true
if (targ->no_pain)
{
tp4teamdmg = true; // don't take damage but still get stopped/bounced by weapon fire
{
if (attacker == targ)
{
tp4teamdmg = true; // don't take damage but still get stopped/bounced by weapon fire
}
else
{
if (targ->invincible_sound < g_globalvars.time)
{
sound(targ, CHAN_AUTO, "items/protect3.wav", 0.75, ATTN_NORM);
targ->invincible_sound = g_globalvars.time + 2;
}

return;
}
}
}

Expand Down
Loading