Copy buildings that aren't available
Closed this issue · 3 comments
It is currently possible to use the copy hotkey to pick a building that isn't available on the map. I've come across this bug in a map I'm making, where I placed down a building and then used save hex editing to not allow players to build more of that building
I know this bug doesn't affect anyone else other than me but I'd like to know if it would be possible to fix it
How exactly are you disabling the buildings? Can you upload an example savefile?
There's already a check in the code for whether the scenario has that building enabled (source), so I'm wondering what else we would need to do.
Here: Pilgrims-Bastion-By-7Soul.zip
I'm writing byte 0 to 0x126342 (fort) and 0x12634A (temple) in the save file
Thanks! I see the problem now.
The code we're using to check whether a building is allowed was originally meant for enabling/disabling the build menus using the allowed buildings from the editor; we started using it for the clone hotkey later. The buildings you're trying to disable are behind a "menu group" type such as "temples", "farms", "forts". The code currently only handles the groups, so the menu group is disabled, but the individual buildings below it are still technically enabled (see for example here for temples), which allows copying them.
This can certainly be fixed (and will be in a minute), but please note that people using an older version of Julius/Augustus will still be able to clone the building.