relocate customization application

Resolves #1450
This commit is contained in:
nhmall
2025-10-06 11:49:31 -04:00
parent 9f6d1d17dd
commit 38161f3e4a
4 changed files with 14 additions and 3 deletions
+1
View File
@@ -1155,6 +1155,7 @@ extern void dump_glyphids(void);
extern void clear_all_glyphmap_colors(void); extern void clear_all_glyphmap_colors(void);
extern void reset_customcolors(void); extern void reset_customcolors(void);
extern int glyph_to_cmap(int); extern int glyph_to_cmap(int);
extern void maybe_shuffle_customizations(void);
/* ### hack.c ### */ /* ### hack.c ### */
+1
View File
@@ -254,6 +254,7 @@ struct instance_flags {
boolean remember_getpos; /* save getpos() positioning in do-again queue */ boolean remember_getpos; /* save getpos() positioning in do-again queue */
boolean sad_feeling; /* unseen pet is dying */ boolean sad_feeling; /* unseen pet is dying */
boolean showdamage; /* extra message reporting damage hero has taken */ boolean showdamage; /* extra message reporting damage hero has taken */
boolean pending_customizations; /* at least one custom. was specified */
xint8 debug_fuzzer; /* fuzz testing */ xint8 debug_fuzzer; /* fuzz testing */
int at_midnight; /* only valid during end of game disclosure */ int at_midnight; /* only valid during end of game disclosure */
int at_night; /* also only valid during end of game disclosure */ int at_night; /* also only valid during end of game disclosure */
+2
View File
@@ -178,6 +178,8 @@ moveloop_core(void)
#ifdef POSITIONBAR #ifdef POSITIONBAR
do_positionbar(); do_positionbar();
#endif #endif
if (iflags.pending_customizations)
maybe_shuffle_customizations();
dobjsfree(); dobjsfree();
+10 -3
View File
@@ -568,15 +568,22 @@ apply_customizations(
} }
} }
} }
if (at_least_one) { iflags.pending_customizations = at_least_one;
shuffle_customizations();
}
} }
/* Shuffle the customizations to match shuffled object descriptions, /* Shuffle the customizations to match shuffled object descriptions,
* so a red potion isn't displayed with a blue customization, and so on. * so a red potion isn't displayed with a blue customization, and so on.
*/ */
void
maybe_shuffle_customizations(void)
{
if (iflags.pending_customizations) {
shuffle_customizations();
iflags.pending_customizations = 0;
}
}
#if 0 #if 0
staticfn void staticfn void
shuffle_customizations(void) shuffle_customizations(void)