Fix crash when editing dialog strings

This commit is contained in:
2017-01-31 21:23:12 -05:00
parent e7ae0b28a2
commit 0e109ecd5c

View File

@@ -1107,12 +1107,14 @@ void edit_dialog_text(eStrMode mode,short *str1,cDialog* parent) {
break; break;
} }
} }
for(short i = *str1; i < *str1 + 6; i++) if(*str1 >= 0) {
fetch_str(mode, i).clear(); for(short i = *str1; i < *str1 + 6; i++)
fetch_str(mode, i).clear();
}
} }
if(*str1 < 0) { if(*str1 < 0) {
showError("To create a dialog, you need 6 consecutive unused messages. To free up 6 messages, select Edit Out/Town/Scenario Text from the menus.","",parent); *str1 = num_strs(mode);
return; ensure_str(mode, *str1 + 5);
} }
using namespace std::placeholders; using namespace std::placeholders;