From 42a764998babede38d671e401adec73f6f3bda0b Mon Sep 17 00:00:00 2001 From: Freagarach Date: Thu, 16 Nov 2023 09:40:44 +0000 Subject: [PATCH] Add error to TechMan. when trying to finish a non-existing technology (e.g. wrong allied_view tech defined). git-svn-id: https://svn.wildfiregames.com/public/ps/trunk@27935 3db68df2-c116-0410-a063-a993310a9797 --- binaries/data/mods/public/simulation/components/TechnologyManager.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/binaries/data/mods/public/simulation/components/TechnologyManager.js b/binaries/data/mods/public/simulation/components/TechnologyManager.js index 1702b4ce7c..b1be6ddfad 100644 --- a/binaries/data/mods/public/simulation/components/TechnologyManager.js +++ b/binaries/data/mods/public/simulation/components/TechnologyManager.js @@ -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); -- 2.11.4.GIT