Skip to content

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

@Seniru

Description

@Seniru

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions