From 715e778b29282caffd04b5c2fef00479a8d3d21a Mon Sep 17 00:00:00 2001 From: kinther Date: Tue, 23 Dec 2025 07:50:59 -0800 Subject: [PATCH] Fix duration stat output and add class identifier --- src/act.wizard.c | 6 ++++-- src/class.c | 4 ++-- src/utils.h | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/act.wizard.c b/src/act.wizard.c index a1f4446..2122c3d 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -411,7 +411,9 @@ static void stat_format_char_effects(struct char_data *k, char *buf, size_t buf_ const char *dur_unit = "hr"; int display_dur = aff->duration + 1; - if (aff->spell == SKILL_PERCEPTION) { + if (aff->spell == SKILL_PERCEPTION || + aff->spell == SPELL_SCAN_AFFECT || + aff->spell == SPELL_LISTEN_AFFECT) { /* convert mud-hours -> real minutes (round up) */ int total_seconds = display_dur * SECS_PER_MUD_HOUR; display_dur = (total_seconds + SECS_PER_REAL_MIN - 1) / SECS_PER_REAL_MIN; @@ -1813,7 +1815,7 @@ static void do_stat_character(struct char_data *ch, struct char_data *k) (k->player.time.played % 3600) / 60); } - stat_table_row_fmt(ch, "Level", "Level %d %s", GET_LEVEL(k), CLASS_ABBR(k)); + stat_table_row_fmt(ch, "Class", "%s", CLASS_NAME(k)); stat_table_row_fmt(ch, "Attributes", "Str %d Int %d Wis %d Dex %d Con %d Cha %d", diff --git a/src/class.c b/src/class.c index 5ec0577..7081ef4 100644 --- a/src/class.c +++ b/src/class.c @@ -26,10 +26,10 @@ /* Names first */ const char *class_abbrevs[] = { - "Mu", + "So", "Cl", "Ro", - "Wa", + "Fi", "Ba", "Ra", "Br", diff --git a/src/utils.h b/src/utils.h index 841f231..236a0bc 100644 --- a/src/utils.h +++ b/src/utils.h @@ -938,6 +938,9 @@ do \ /** Return the class abbreviation for ch. */ #define CLASS_ABBR(ch) (HAS_VALID_CLASS(ch) ? class_abbrevs[(int)GET_CLASS(ch)] : "--") +/** Return the class abbreviation for ch. */ +#define CLASS_NAME(ch) (HAS_VALID_CLASS(ch) ? pc_class_types[(int)GET_CLASS(ch)] : "--") + /** 1 if ch is sorceror class, 0 if not. */ #define IS_SORCEROR(ch) (HAS_VALID_CLASS(ch) && (GET_CLASS(ch) == CLASS_SORCEROR)) /** 1 if ch is cleric class, 0 if not. */