CORPORATION: Print error message when player cannot create corporation (#1820)

This commit is contained in:
catloversg
2024-12-02 04:50:32 +07:00
committed by GitHub
parent 6e1848dd79
commit 933ec964cf
3 changed files with 24 additions and 8 deletions
+5 -1
View File
@@ -606,7 +606,11 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
(_corporationName, _selfFund = true): boolean => {
const corporationName = helpers.string(ctx, "corporationName", _corporationName);
const selfFund = !!_selfFund;
return createCorporation(corporationName, selfFund, false);
const result = createCorporation(corporationName, selfFund, false);
if (!result.success) {
helpers.log(ctx, () => result.message);
}
return result.success;
},
getConstants: () => () => {
/* TODO 2.2: possibly just rework the whole corp constants structure to be more readable, and just use