keep propertynames static in timeout.c

This commit is contained in:
nhmall
2022-11-06 10:02:27 -05:00
parent 38ff4029aa
commit 9e92fefdd8
3 changed files with 17 additions and 10 deletions

View File

@@ -21,7 +21,7 @@ static void cleanup_burn(ANY_P *, long);
/* used by wizard mode #timeout and #wizintrinsic; order by 'interest'
for timeout countdown, where most won't occur in normal play */
const struct propname {
static const struct propname {
int prop_num;
const char *prop_name;
} propertynames[] = {
@@ -105,6 +105,17 @@ const struct propname {
{ 0, 0 },
};
const char *
property_by_index(int idx, int *propertynum)
{
if (!(idx >= 0 && idx < SIZE(propertynames) - 1))
idx = SIZE(propertynames) - 1;
if (propertynum)
*propertynum = propertynames[idx].prop_num;
return propertynames[idx].prop_name;
}
/* He is being petrified - dialogue by inmet!tower */
static NEARDATA const char *const stoned_texts[] = {
"You are slowing down.", /* 5 */