Skip to content

Commit f280f11

Browse files
authored
Fix AI Goal Display Strings (#4451)
* Fix AI Goal Display Strings Okay so previously, if a target goal was not valid the code was `strcpy(outbuf, XSTR("no orders", 495)); ` but then it was changed to `outbuf += XSTR("no orders", 495);` So it would instead append the "no orders" instead of properly replace the whole string. Looks just like a copy and paster oversight, since all the other text appends the name of the target with the order. This PR correctly replaces, rather than appends that text. Fixes #4345 * appease clang * use more simple =
1 parent e7b73da commit f280f11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

code/ship/ship.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15843,7 +15843,7 @@ SCP_string ship_return_orders(ship* sp)
1584315843
outbuf += target_name;
1584415844
outbuf += XSTR(" wing", 494);
1584515845
} else {
15846-
outbuf += XSTR("no orders", 495);
15846+
outbuf = XSTR("no orders", 495);
1584715847
}
1584815848
break;
1584915849

@@ -15852,7 +15852,7 @@ SCP_string ship_return_orders(ship* sp)
1585215852
outbuf += XSTR("any ", -1);
1585315853
outbuf += target_name;
1585415854
} else {
15855-
outbuf += XSTR("no orders", 495);
15855+
outbuf = XSTR("no orders", 495);
1585615856
}
1585715857
break;
1585815858

@@ -15868,7 +15868,7 @@ SCP_string ship_return_orders(ship* sp)
1586815868
if (aigp->target_name) {
1586915869
outbuf += target_name;
1587015870
} else {
15871-
outbuf += XSTR("no orders", 495);
15871+
outbuf = XSTR("no orders", 495);
1587215872
}
1587315873
break;
1587415874

@@ -15879,7 +15879,7 @@ SCP_string ship_return_orders(ship* sp)
1587915879
hud_targetbox_truncate_subsys_name(subsys_name);
1588015880
sprintf(outbuf, XSTR("atk %s %s", 496), target_name, subsys_name);
1588115881
} else {
15882-
outbuf += XSTR("no orders", 495);
15882+
outbuf = XSTR("no orders", 495);
1588315883
}
1588415884
break;
1588515885
}

0 commit comments

Comments
 (0)