- Update SAV_VERSIONMINOR so 2.0/2.1 cup backup files won't load
- Move specialDamage to grandprixinfo_t (from rank_t, per Sal review)
This commit is contained in:
toaster 2024-05-05 20:07:54 +01:00
parent cf696ac5c7
commit 2dc8ce330a
5 changed files with 11 additions and 7 deletions

View file

@ -4977,7 +4977,7 @@ void G_DirtyGameData(void)
// Can be called by the startup code or the menu task.
//
#define SAV_VERSIONMINOR 5
#define SAV_VERSIONMINOR 6
void G_LoadGame(void)
{

View file

@ -39,6 +39,7 @@ extern struct grandprixinfo
boolean initalize; ///< If true, we need to initialize a new session.
boolean wonround; ///< If false, then we retry the map instead of going to the next.
gpEvent_e eventmode; ///< Special event mode, bots are set to spectate and a special gametype is played
UINT32 specialDamage; ///< Accumulated Sealed Star difficulty reduction
gpRank_t rank; ///< Struct containing grading information. (See also: k_rank.h)
} grandprixinfo;

View file

@ -53,7 +53,6 @@ struct gpRank_t
UINT32 totalLaps;
UINT32 continuesUsed;
UINT32 specialDamage;
UINT32 prisons;
UINT32 totalPrisons;

View file

@ -938,7 +938,7 @@ boolean Obj_SpecialUFODamage(mobj_t *ufo, mobj_t *inflictor, mobj_t *source, UIN
if (grandprixinfo.gp)
{
grandprixinfo.rank.specialDamage += damage;
grandprixinfo.specialDamage += damage;
}
K_SetHitLagForObjects(ufo, inflictor, source, (damage / 3) + 2, true);
@ -1345,9 +1345,9 @@ static mobj_t *InitSpecialUFO(waypoint_t *start)
P_SetTarget(&ufo_piece_prev(piece), prevPiece);
prevPiece = piece;
if (grandprixinfo.gp && grandprixinfo.rank.specialDamage)
if (grandprixinfo.gp && grandprixinfo.specialDamage)
{
ufo->health -= min(4*mobjinfo[MT_SPECIAL_UFO].spawnhealth/10, grandprixinfo.rank.specialDamage/6);
ufo->health -= min(4*mobjinfo[MT_SPECIAL_UFO].spawnhealth/10, grandprixinfo.specialDamage/6);
}
return ufo;

View file

@ -6069,6 +6069,8 @@ static inline void P_ArchiveMisc(savebuffer_t *save)
WRITEUINT8(save->p, (UINT8)grandprixinfo.encore);
WRITEUINT8(save->p, (UINT8)grandprixinfo.masterbots);
WRITEUINT32(save->p, grandprixinfo.specialDamage);
WRITESTRINGL(save->p, grandprixinfo.cup->name, MAXCUPNAME);
// Round Queue information
@ -6136,7 +6138,6 @@ static inline void P_ArchiveMisc(savebuffer_t *save)
WRITEUINT32(save->p, rank->totalLaps);
WRITEUINT32(save->p, (rank->continuesUsed + 1));
WRITEUINT32(save->p, rank->specialDamage);
WRITEUINT32(save->p, rank->prisons);
WRITEUINT32(save->p, rank->totalPrisons);
@ -6217,6 +6218,8 @@ void P_GetBackupCupData(savebuffer_t *save)
cupsavedata.encore = (boolean)READUINT8(save->p);
boolean masterbots = (boolean)READUINT8(save->p);
save->p += 4; // specialDamage
if (masterbots == true)
cupsavedata.difficulty = KARTGP_MASTER;
@ -6266,6 +6269,8 @@ static boolean P_UnArchiveSPGame(savebuffer_t *save)
grandprixinfo.encore = (boolean)READUINT8(save->p);
grandprixinfo.masterbots = (boolean)READUINT8(save->p);
grandprixinfo.specialDamage = READUINT32(save->p);
// Find the relevant cup.
char cupname[MAXCUPNAME];
READSTRINGL(save->p, cupname, sizeof(cupname));
@ -6395,7 +6400,6 @@ static boolean P_UnArchiveSPGame(savebuffer_t *save)
rank->totalLaps = READUINT32(save->p);
rank->continuesUsed = READUINT32(save->p);
rank->specialDamage = READUINT32(save->p);
rank->prisons = READUINT32(save->p);
rank->totalPrisons = READUINT32(save->p);