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

AI declares false bankruptcy when left with lands with houses/hotels #47

Open
Seniru opened this issue Jul 14, 2024 · 0 comments
Open

Comments

@Seniru
Copy link

Seniru commented Jul 14, 2024

AI is unable to sell houses/hotels on lands and as a result it declares in bankruptcy (while having more property to sell/mortgage)

https://github.com/intrepidcoder/monopoly/blob/master/ai.js#L177-192

I've had a quick look at the code, think this needs to be changed.

if (s.owner === p.index && !s.mortgage) {
        if (s.house === 0) {
	        mortgage(i);
	        console.log(s.name);
        } else {
                // logic to sell houses/hotels in each land consecutively as needed
        }
}

I'd love to open a PR with necessary changes if you want me to. Thanks!

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