From fee6a9175117d899efeef515b2a5898058306655 Mon Sep 17 00:00:00 2001 From: Dustinspace217 Date: Wed, 18 Nov 2026 02:40:58 -0800 Subject: [PATCH] Warn when +Use Template: is used on a ship class that already exists A ship template is a complete ship entry, so applying one in a modular table to a class that is already defined replaces the whole class, not only the values the template sets. The class can lose its model, and nothing said so until a mission tried to create the ship. Show a warning at table load, in release builds too, naming the class and the template. The template is still applied as before. --- code/ship/ship.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index b4e6907e499..f644456e039 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -1687,6 +1687,14 @@ static void parse_ship(const char *filename, bool replace) stuff_string(template_name, F_NAME, SHIP_MULTITEXT_LENGTH); int template_id = ship_template_lookup(template_name); if ( template_id != -1 ) { + if (ship_id >= 0) { + error_display(2, + "A template was specified for ship class '%s', which already exists. Template '%s' replaces " + "the whole existing entry, not only the values it sets. To change only some values, list " + "them without '+Use Template:'.", + fname, + template_name); + } first_time = false; sip->clone(Ship_templates[template_id]); strcpy_s(sip->name, fname);