- for initializing tab commands a separate static lookup function must be used to get the button names.

Because order of initialization for static objects is undefined.
This commit is contained in:
Christoph Oelckers 2019-11-04 23:11:10 +01:00
parent 570696fc09
commit 8d089a11fa
2 changed files with 12 additions and 1 deletions

View file

@ -128,6 +128,15 @@ static const ButtonDesc gamefuncs[] = {
};
// This is for use by the tab command builder which can run before the optimized tables are initialized.
const char* StaticGetButtonName(int32_t func)
{
for (auto& entry : gamefuncs)
if (entry.index == func) return entry.name;
return "";
}
//=============================================================================
//