When reading mission file, check for sanity of possible breifing or ending to make sure author did not just screw up the file; Fixed slight bug when playing ending briefings from secret levels

This commit is contained in:
zicodxx 2010-07-08 22:20:39 +00:00
parent 52b57dbd31
commit 152ed8ea60

View file

@ -538,16 +538,18 @@ int load_mission(mle *mission)
if ((v = get_value(buf)) != NULL) {
add_term(v);
if (strlen(v) < 13 && strlen(v) > 0)
if (!stricmp(strrchr(v, '.'), ".tex") || !stricmp(strrchr(v, '.'), ".txb"))
strcpy(Briefing_text_filename,v);
if (strrchr(v, '.'))
if (!stricmp(strrchr(v, '.'), ".tex") || !stricmp(strrchr(v, '.'), ".txb"))
strcpy(Briefing_text_filename,v);
}
}
else if (istok(buf,"ending")) {
if ((v = get_value(buf)) != NULL) {
add_term(v);
if (strlen(v) < 13 && strlen(v) > 0)
if (!stricmp(strrchr(v, '.'), ".tex") || !stricmp(strrchr(v, '.'), ".txb"))
strcpy(Ending_text_filename,v);
if (strrchr(v, '.'))
if (!stricmp(strrchr(v, '.'), ".tex") || !stricmp(strrchr(v, '.'), ".txb"))
strcpy(Ending_text_filename,v);
}
}
else if (istok(buf,"num_levels")) {