Skip to content

Conversation

@myk002
Copy link
Member

@myk002 myk002 commented Jun 5, 2024

fixes poor execution of #4664

@myk002 myk002 merged commit 27977d2 into DFHack:develop Jun 5, 2024
@myk002 myk002 deleted the myk_cpp_mortal branch June 5, 2024 03:15
Comment on lines +2384 to +2392
void Core::setMortalMode(bool value) {
mortal_mode = value;
}

void Core::setArmokTools(const std::vector<std::string> &tool_names) {
armok_tools.clear();
armok_tools.insert(tool_names.begin(), tool_names.end());
}

Copy link
Member

@lethosor lethosor Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a mutex guarding all of these accesses (not exclusive to these two functions) because SelectHotkey is called from the input thread. (I haven't looked to see if there is an existing appropriate mutex)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding that (07ad3a2)

dfhack.HIDE_CONSOLE_ON_STARTUP = value
end

dfhack.HIDE_ARMOK_TOOLS = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intended to be publicly accessible? If not, I would make it local instead of a member of dfhack. If you do want it publicly accessible, you should be aware that it is possible to set this variable without calling setMortalMode(), which would lead to an inconsistent state.

Same goes for HIDE_CONSOLE_ON_STARTUP, although I think the effects are more limited.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was intended to be publicly accessible, but this change makes it unwise to access directly. Now that I've removed references to it (gui/control-panel, docs), it's good to make it local. will make that change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in #4679

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right - I knew it was previously public - was meaning to ask "is this still intended"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Don't call out to Lua in keybinding armok check

2 participants