Report correct ending success/failure when any counter-op player aborts

This commit is contained in:
GreaseMonkey committed 2024-02-09 16:15:09 +13:00
1 parent 92d3a9f564
commit 94e244a236
2 files changed
+34 -7

No files matched your search

+27 -6
View File
@@ -292,6 +292,27 @@ char *endscreenMenuTextAccuracy(struct menuitem *item)
return g_StringPointer;
}
#if MAX_COOPCHRS > 2
static bool enscreenAnyAntiAborted(void) {
size_t num;
if (g_Vars.antiplayernum < 0) {
return false;
}
for (num = 0; num < PLAYERCOUNT(); num++) {
if (PLAYERNUM_IS_ANTI(num) && g_Vars.players[num] && g_Vars.players[num]->aborted) {
return true;
}
}
return false;
}
#define ANTI_ABORTED() (enscreenAnyAntiAborted())
#else
#define ANTI_ABORTED() (g_Vars.anti->aborted)
#endif
char *endscreenMenuTextMissionStatus(struct menuitem *item)
{
if (g_CheatsActiveBank0 || g_CheatsActiveBank1) {
@@ -312,7 +333,7 @@ char *endscreenMenuTextMissionStatus(struct menuitem *item)
return langGet(L_OPTIONS_295); // "Aborted"
}
if (g_Vars.anti->aborted) {
if (ANTI_ABORTED()) {
return langGet(L_OPTIONS_295); // "Aborted"
}
@@ -320,7 +341,7 @@ char *endscreenMenuTextMissionStatus(struct menuitem *item)
return langGet(L_OPTIONS_293); // "Failed"
}
} else {
if (g_Vars.anti->aborted) {
if (ANTI_ABORTED()) {
return langGet(L_OPTIONS_295); // "Aborted"
}
@@ -1795,9 +1816,9 @@ void endscreenPushAnti(void)
if (g_Vars.currentplayer == g_Vars.bond) {
#if VERSION >= VERSION_NTSC_1_0 && defined(DEBUG)
if (!g_Vars.anti->aborted && (g_Vars.bond->isdead || g_Vars.bond->aborted || !objectiveIsAllComplete()) && !debugIsSetCompleteEnabled())
if (!ANTI_ABORTED() && (g_Vars.bond->isdead || g_Vars.bond->aborted || !objectiveIsAllComplete()) && !debugIsSetCompleteEnabled())
#else
if (!g_Vars.anti->aborted && (g_Vars.bond->isdead || g_Vars.bond->aborted || !objectiveIsAllComplete()))
if (!ANTI_ABORTED() && (g_Vars.bond->isdead || g_Vars.bond->aborted || !objectiveIsAllComplete()))
#endif
{
// Bond - failed or aborted
@@ -1826,9 +1847,9 @@ void endscreenPushAnti(void)
filemgrSaveOrLoad(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
} else {
#if VERSION >= VERSION_NTSC_1_0 && defined(DEBUG)
if (!g_Vars.anti->aborted && (g_Vars.bond->isdead || g_Vars.bond->aborted || !objectiveIsAllComplete()) && !debugIsSetCompleteEnabled())
if (!ANTI_ABORTED() && (g_Vars.bond->isdead || g_Vars.bond->aborted || !objectiveIsAllComplete()) && !debugIsSetCompleteEnabled())
#else
if (!g_Vars.anti->aborted && (g_Vars.bond->isdead || g_Vars.bond->aborted || !objectiveIsAllComplete()))
if (!ANTI_ABORTED() && (g_Vars.bond->isdead || g_Vars.bond->aborted || !objectiveIsAllComplete()))
#endif
{
// Anti - completed
+7 -1
View File
@@ -20,7 +20,11 @@
#define MAX_CHRWAYPOINTS 6
#define MAX_EXPLOSIONS 6
#define MAX_EYESPYDARTS 8
#ifdef PLATFORM_N64
#define MAX_COOPCHRS 2
#else
#define MAX_COOPCHRS MAX_PLAYERS
#endif
#define MAX_MPCHRS (MAX_PLAYERS + MAX_BOTS)
#define MAX_MPPLAYERCONFIGS (MAX_PLAYERS + MAX_COOPCHRS)
#define MAX_OBJECTIVES 10
@@ -82,14 +86,16 @@
#define PLAYERCOUNT() 1
#endif
#if MAX_LOCAL_PLAYERS > 2
#if MAX_COOPCHRS > 2
#define PLAYER_IS_ANTI(plr) (g_Vars.antiplayernum >= 0 && (plr) != g_Vars.bond)
#define PLAYER_IS_NOT_ANTI(plr) (g_Vars.antiplayernum < 0 || (plr) == g_Vars.bond)
#define PLAYERNUM_IS_ANTI(plrnum) (g_Vars.antiplayernum >= 0 && (plrnum) != g_Vars.bondplayernum)
#define PROP_IS_FOR_ANTI_PLAYER(plrprop) (g_Vars.antiplayernum >= 0 && g_Vars.anti && (plrprop)->type == PROPTYPE_PLAYER && (plrprop) != g_Vars.bond->prop)
#define EXPLOSION_OWNER_IS_ANTI_PLAYER(expowner) (g_Vars.antiplayernum >= 0 && (expowner) != g_Vars.bondplayernum && mpGetChrFromPlayerIndex((expowner)) != NULL)
#else
#define PLAYER_IS_ANTI(plr) ((plr) == g_Vars.anti)
#define PLAYER_IS_NOT_ANTI(plr) ((plr) != g_Vars.anti)
//define PLAYERNUM_IS_ANTI(plrnum) ((plrnum) == g_Vars.antiplayernum)
#define PROP_IS_FOR_ANTI_PLAYER(plrprop) ((plrprop) == g_Vars.anti->prop)
#define EXPLOSION_OWNER_IS_ANTI_PLAYER(expowner) ((expowner) == g_Vars.antiplayernum)
#endif