Skip to content

Implement sub_4A6DA9#3084

Merged
duncanspumpkin merged 2 commits intoOpenLoco:masterfrom
duncanspumpkin:setupUiCompanyDefaults
Apr 26, 2025
Merged

Implement sub_4A6DA9#3084
duncanspumpkin merged 2 commits intoOpenLoco:masterfrom
duncanspumpkin:setupUiCompanyDefaults

Conversation

@duncanspumpkin
Copy link
Copy Markdown
Contributor

pretty simple little function.

@duncanspumpkin duncanspumpkin added this to the v25.03+ milestone Apr 26, 2025
@duncanspumpkin duncanspumpkin merged commit 5f6339f into OpenLoco:master Apr 26, 2025
10 checks passed
@duncanspumpkin duncanspumpkin deleted the setupUiCompanyDefaults branch April 26, 2025 20:45
@AaronVanGeffen
Copy link
Copy Markdown
Member

AaronVanGeffen commented Jul 25, 2025

This function has three callers. Until today, only one of these was implemented (CompanyManager::createPlayerCompany). With another caller, #3164, merged, the game now crashes in this function when a new landscape is being generated. (The function was not hooked, which is presumably why it went unnoticed.)

static void sub_4A6DA9()
{
call(0x004A6DA9);
auto* playerCompany = getPlayerCompany();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this will crash if there are not player companies, e.g. in the scenario editor.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants