Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 4538490

Browse files
committed
Abort on missing preset
1 parent 80bb0c2 commit 4538490

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

System/Entity.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,12 @@ namespace RTE {
5757
if (className == "AtomGroup" || className == "Attachable" || className == "AEmitter") {
5858
reader.ReportError("The PresetName to be copied was not found in data modules.");
5959
}
60+
std::string err = "ERROR: Couldn't find the preset '" + refName + "' accessed in " + reader.GetCurrentFilePath() + " at line " + reader.GetCurrentFileLine();
6061
// If we couldn't find the preset to copy from, read it as an original but report the problem in the console
61-
g_ConsoleMan.PrintString("ERROR: Couldn't find the preset '" + refName + "' accessed in " + reader.GetCurrentFilePath() + " at line " + reader.GetCurrentFileLine());
62-
// Preset name might have "[ModuleName]/" preceding it, detect it here and select proper module!
63-
int slashPos = refName.find_first_of('/');
64-
m_PresetName = (slashPos != std::string::npos) ? refName.substr(slashPos + 1) : refName;
65-
// Mark this so that the derived class knows it should be added to the PresetMan when it's done reading all properties.
66-
m_IsOriginalPreset = true;
67-
// Indicate where this was read from
68-
m_DefinedInModule = reader.GetReadModuleID();
62+
g_ConsoleMan.PrintString(err);
63+
g_ConsoleMan.Destroy();
64+
// Abort the game with same error message
65+
RTEAssert(false, err);
6966
}
7067
} else if (propName == "PresetName" || propName == "InstanceName") {
7168
SetPresetName(reader.ReadPropValue());

0 commit comments

Comments
 (0)