View Issue Details

IDProjectCategoryView StatusLast Update
0002372FSSCPtablespublic2012-11-19 15:25
ReporterFury Assigned ToThe_E  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionAntipodes 8 
Fixed in Version3.6.13 
Summary0002372: +Description broken in ships.tbl
DescriptionNo idea if it has ever worked, but it's broken now.

Example:
$Name: GTF Myrmidon
+nocreate
    +Description: XSTR("
    insert
    bunch of text
    here
    ", -1 )
    $end_multi_text

Produces exactly jack squat on ship's loadout display.
TagsNo tags attached.

Activities

The_E

2011-01-23 21:19

administrator   ~0012610

Fixed in revision 6969

FUBAR-BDHR

2011-01-29 23:45

developer   ~0012617

Well this fix breaks multiplayer and the description is not like broke correctly resulting in a possible second assert for MAX_NUM_SHIP_DESC_LINES being exceeded. This one happens in both single and multi.

Example:

+Description: XSTR("test description", -1)
$end_multi_text

results in:
test
descr
iption

+Description: XSTR("A much longer test description of this ship to see what happens", -1)
$end_multi_text

results in the assert.

I'll attach a diff that seems to work around the first multi problem.

2011-01-29 23:50

 

mantis_2372.patch (2,901 bytes)   
Index: multiteamselect.cpp
===================================================================
--- multiteamselect.cpp	(revision 6979)
+++ multiteamselect.cpp	(working copy)
@@ -2625,40 +2625,43 @@
 	// split the text info up	
 	
 	Assert(Multi_ts_select_ship_class >= 0);
-	Assert((Ship_info[Multi_ts_select_ship_class].desc != NULL) && strlen(Ship_info[Multi_ts_select_ship_class].desc));
+//	Assert((Ship_info[Multi_ts_select_ship_class].desc != NULL) && strlen(Ship_info[Multi_ts_select_ship_class].desc));
+	if (Ship_info[Multi_ts_select_ship_class].desc != NULL)
+	{
 
-	// strip out newlines
-	memset(ship_desc,0,1000);
-	strcpy_s(ship_desc,Ship_info[Multi_ts_select_ship_class].desc);
-	token = strtok(ship_desc,"\n");
-	if(token != NULL){
-		strcpy_s(Multi_ts_ship_info_text,token);
-		while(token != NULL){
-			token = strtok(NULL,"\n");
-			if(token != NULL){
-				strcat_s(Multi_ts_ship_info_text," ");
-				strcat_s(Multi_ts_ship_info_text,token);
+		// strip out newlines
+		memset(ship_desc,0,1000);
+		strcpy_s(ship_desc,Ship_info[Multi_ts_select_ship_class].desc);
+		token = strtok(ship_desc,"\n");
+		if(token != NULL){
+			strcpy_s(Multi_ts_ship_info_text,token);
+			while(token != NULL){
+				token = strtok(NULL,"\n");
+				if(token != NULL){
+					strcat_s(Multi_ts_ship_info_text," ");
+					strcat_s(Multi_ts_ship_info_text,token);
+				}
 			}
 		}
-	}
 	
-	if(strlen(Multi_ts_ship_info_text) > 0){
-		// split the string into multiple lines
-		n_lines = split_str(Multi_ts_ship_info_text, Multi_ts_ship_info_coords[gr_screen.res][MULTI_TS_W_COORD], n_chars, p_str, MULTI_TS_SHIP_INFO_MAX_LINES, 0);	
+		if(strlen(Multi_ts_ship_info_text) > 0){
+			// split the string into multiple lines
+			n_lines = split_str(Multi_ts_ship_info_text, Multi_ts_ship_info_coords[gr_screen.res][MULTI_TS_W_COORD], n_chars, p_str, MULTI_TS_SHIP_INFO_MAX_LINES, 0);	
 
-		// copy the split up lines into the text lines array
-		for (int idx = 0;idx<n_lines;idx++ ) {
-			Assert(n_chars[idx] < MULTI_TS_SHIP_INFO_MAX_LINE_LEN);
-			strncpy(Multi_ts_ship_info_lines[idx], p_str[idx], n_chars[idx]);
-			Multi_ts_ship_info_lines[idx][n_chars[idx]] = 0;
-			drop_leading_white_space(Multi_ts_ship_info_lines[idx]);		
+			// copy the split up lines into the text lines array
+			for (int idx = 0;idx<n_lines;idx++ ) {
+				Assert(n_chars[idx] < MULTI_TS_SHIP_INFO_MAX_LINE_LEN);
+				strncpy(Multi_ts_ship_info_lines[idx], p_str[idx], n_chars[idx]);
+				Multi_ts_ship_info_lines[idx][n_chars[idx]] = 0;
+				drop_leading_white_space(Multi_ts_ship_info_lines[idx]);		
+			}
+
+			// get the line count
+			Multi_ts_ship_info_line_count = n_lines;
+		} else {
+			// set the line count to 
+			Multi_ts_ship_info_line_count = 0;
 		}
-
-		// get the line count
-		Multi_ts_ship_info_line_count = n_lines;
-	} else {
-		// set the line count to 
-		Multi_ts_ship_info_line_count = 0;
 	}	
 }
 
mantis_2372.patch (2,901 bytes)   

chief1983

2012-01-27 22:10

administrator   ~0013170

Apparently this patch was committed in 7002. Is there anything still broken mentioned in this ticket?

Zacam

2012-01-28 06:47

administrator   ~0013174

Tested with the above snippets. No Assert reached.

The second +Description entry did lead to a bit of a text area over draw in the interface though: http://img713.imageshack.us/img713/7347/descriptiontest.png

Additionally, when setting up for the second +Description test, I accidentally forgot to include the "$end_multi_text" which did not result in any pop-up warnings, but did lead to this easily missed entry in the log:
"Error. Too much text (28553 chars, 4096 allowed) before $end_multi_text"

Build test: Antipodes 8370 build.

chief1983

2012-10-31 20:30

administrator   ~0014008

Closing then if no other complaints.

Goober5000

2012-11-19 15:25

administrator   ~0014077

Resolving as it was apparently fixed by The E, twice.

Issue History

Date Modified Username Field Change
2011-01-07 17:18 Fury New Issue
2011-01-23 21:19 The_E Note Added: 0012610
2011-01-23 21:20 The_E Status new => resolved
2011-01-23 21:20 The_E Fixed in Version => 3.6.13
2011-01-23 21:20 The_E Resolution open => fixed
2011-01-23 21:20 The_E Assigned To => The_E
2011-01-29 23:45 FUBAR-BDHR Note Added: 0012617
2011-01-29 23:45 FUBAR-BDHR Status resolved => feedback
2011-01-29 23:45 FUBAR-BDHR Resolution fixed => reopened
2011-01-29 23:50 FUBAR-BDHR File Added: mantis_2372.patch
2012-01-27 22:10 chief1983 Note Added: 0013170
2012-01-28 06:47 Zacam Note Added: 0013174
2012-10-27 11:24 The_E Assigned To The_E =>
2012-10-31 20:30 chief1983 Note Added: 0014008
2012-11-19 15:25 Goober5000 Note Added: 0014077
2012-11-19 15:25 Goober5000 Assigned To => The_E
2012-11-19 15:25 Goober5000 Status feedback => resolved
2012-11-19 15:25 Goober5000 Resolution reopened => fixed