Change the tips internal data struct

Previously adding any new tips invalidated saves; now you can have
up to the number of bits in a long without change in savefile.

Invalidates saves.
This commit is contained in:
Pasi Kallinen
2026-04-04 15:39:43 +03:00
parent 7120a7190e
commit 5f1163c11a
4 changed files with 6 additions and 6 deletions

View File

@@ -168,7 +168,7 @@ struct context_info {
boolean bypasses; /* bypass flag is set on at least one fobj */
boolean door_opened; /* set to true if door was opened during test_move */
boolean resume_wish; /* game was exited while in wish prompt */
boolean tips[NUM_TIPS];
unsigned long tips;
struct dig_info digging;
struct victual_info victual;
struct engrave_info engraving;

View File

@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 136
#define EDITLEVEL 137
/*
* Development status possibilities.

View File

@@ -1834,8 +1834,8 @@ handle_tip(int tip)
if (!flags.tips)
return FALSE;
if (tip >= 0 && tip < NUM_TIPS && !svc.context.tips[tip]) {
svc.context.tips[tip] = TRUE;
if (tip >= 0 && tip < NUM_TIPS && !(svc.context.tips & (1 << tip))) {
svc.context.tips |= (1 << tip);
/* the "Tip:" prefix is a hint to use of OPTIONS=!tips to suppress */
switch (tip) {
case TIP_ENHANCE:
@@ -1886,7 +1886,7 @@ swim_move_danger(coordxy x, coordxy y)
|| liquid_wall) {
if (svc.context.nopick) {
/* moving with m-prefix */
svc.context.tips[TIP_SWIM] = TRUE;
svc.context.tips |= (1 << TIP_SWIM);
return FALSE;
} else if (ParanoidSwim || liquid_wall) {
You("avoid %s into the %s.",

View File

@@ -1330,7 +1330,7 @@ enhance_weapon_skill(void)
boolean speedy = FALSE;
/* player knows about #enhance, don't show tip anymore */
svc.context.tips[TIP_ENHANCE] = TRUE;
svc.context.tips |= (1 << TIP_ENHANCE);
if (wizard && y_n("Advance skills without practice?") == 'y')
speedy = TRUE;