From 52b57dbd31443369dbec4f51dc01a2a7af99ac2a Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Thu, 8 Jul 2010 22:12:53 +0000 Subject: [PATCH] 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 --- CHANGELOG.txt | 4 ++++ main/mission.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 685b22a31..15acea697 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20100709 +-------- +main/mission.c: When reading mission file, check for sanity of possible breifing or ending to make sure author did not just screw up the file + 20100708 -------- main/net_udp.c, main/net_udp.h: Reworked handling of Netlist now also showing full game info; Prevent Clients from sending lite_info; Make lite_info show numconnected instead of numplayers as this would show disconnected ones as well; Removed reusing ports on different instances in Windows build - only screws up several games running on one machine diff --git a/main/mission.c b/main/mission.c index 4bdc210ce..0a55d3272 100644 --- a/main/mission.c +++ b/main/mission.c @@ -537,15 +537,17 @@ int load_mission(mle *mission) else if (istok(buf,"briefing")) { if ((v = get_value(buf)) != NULL) { add_term(v); - if (strlen(v) < 13) - strcpy(Briefing_text_filename,v); + if (strlen(v) < 13 && strlen(v) > 0) + 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) - strcpy(Ending_text_filename,v); + if (strlen(v) < 13 && strlen(v) > 0) + if (!stricmp(strrchr(v, '.'), ".tex") || !stricmp(strrchr(v, '.'), ".txb")) + strcpy(Ending_text_filename,v); } } else if (istok(buf,"num_levels")) {