Fix hedit segfault issue

This commit is contained in:
kinther 2025-10-01 05:50:35 -07:00
parent 8371124765
commit 43028a4e38

View file

@ -84,12 +84,15 @@ ACMD(do_oasis_hedit)
OLC_ZNUM(d) = search_help(OLC_STORAGE(d), LVL_IMPL);
if (help_table[OLC_ZNUM(d)].duplicate) {
for (i = 0; i < top_of_helpt; i++)
if (help_table[i].duplicate == 0 && help_table[i].entry == help_table[OLC_ZNUM(d)].entry) {
/* Only check duplicate chains if we found a real record */
if (OLC_ZNUM(d) != NOWHERE && help_table[OLC_ZNUM(d)].duplicate) {
for (i = 0; i < top_of_helpt; i++) {
if (help_table[i].duplicate == 0 &&
help_table[i].entry == help_table[OLC_ZNUM(d)].entry) {
OLC_ZNUM(d) = i;
break;
}
}
}
if (OLC_ZNUM(d) == NOWHERE) {