Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corp purchasing with faith disabled because it checks army cost #371

Open
davidm88 opened this issue Oct 3, 2024 · 0 comments
Open

Corp purchasing with faith disabled because it checks army cost #371

davidm88 opened this issue Oct 3, 2024 · 0 comments

Comments

@davidm88
Copy link

davidm88 commented Oct 3, 2024

Describe the bug
If you have grand master's chapel, and you have a military academy in a city, you are unable to buy corps with faith when you should be able to. The situation is when you have more than the cost of a corps in faith but less than the cost of an army. This is because there is a bug in productionpanel_CQUI.lua.

To Reproduce
As described above. Example: A field cannon corp costs 990 faith, and an army costs 1485. Once you have over 990 faith, you cannot buy the corps, until you have more than 1485 faith.

Expected behavior
I should be able to buy the corps when I have enough faith.

Screenshots
I don't have a screenshot as I just fixed the problem myself, but here is what it looks like afterwards. Before the bug fix, the corps purchase is disabled until I have 1485 faith.
image

Sorry, I don't have a save file for this one, but it is guaranteed to be reproduced in any game, and you can see the bug in the code.

Additional context
From productionpanel_CQUI.lua:

if (item.Corps) then CQUI_PurchaseTable[item.Hash]["corpsFaith"] = item.CorpsCost; CQUI_PurchaseTable[item.Hash]["corpsFaithDisabled"] = item.ArmyDisabled; CQUI_PurchaseTable[item.Hash]["corpsFaithCallback"] = CQUI_PurchaseUnitCorps(item, data.City); end

I changed the 3rd line, so it uses item.CorpsDisabled

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

No branches or pull requests

1 participant