So there's a bug in the build mode lua with building templates resulting in build mode being exited.
(I consider this is a bug, because it's inconsistent with the behaviour when building other stuff, where you stay in build mode.)
The problem seems to be with the interactions between the following functions:
in /lua/ui/game/buildmode.lua:
- Code: Select all
local function HandleBuildTemplate(key, modifiers)
if not Construction.HandleBuildModeKey(key) then
PlayErrorSound()
end
return true
end
in /lua/ui/game/construction.lua:
- Code: Select all
function HandleBuildModeKey(key)
if capturingKeys then
ProcessKeybinding(key)
else
BuildTemplate(key)
end
end
So the problem is that HandleBuildModeKey() eats the return value of BuildTemplate(), and then HandleBuildTemplate() thinks that this failed.
This is easy enough to fix, and I've fixed this locally by hooking this code in a mod, but it seems like this is something that should be fixed in the actual base lua code itself.
(Just for info, to build templates from build mode, you need to right click on the template and set up a key for it, if not already set up, and then, when in build mode, press '5' to switch to the templates tab.)