Add error to TechMan. when trying to finish a non-existing technology (e.g. wrong allied_view tech defined).

This was SVN commit r27935.
This commit is contained in:
Freagarach 2023-11-16 09:40:44 +00:00
parent a90a3a7e48
commit 0dcaefc2f6

View File

@ -90,6 +90,9 @@ TechnologyManager.prototype.Technology.prototype.Finish = function()
this.finished = true;
const template = TechnologyTemplates.Get(this.templateName);
if (!template)
error("Trying to finish non-existing technology: " + this.templateName + ".")
if (template.soundComplete)
Engine.QueryInterface(SYSTEM_ENTITY, IID_SoundManager)?.PlaySoundGroup(template.soundComplete, this.researcher);