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

Wrong threatFor? #7

Closed
aropan opened this issue Apr 21, 2022 · 2 comments
Closed

Wrong threatFor? #7

aropan opened this issue Apr 21, 2022 · 2 comments
Assignees
Labels
bug Something isn't working minor Minor issue

Comments

@aropan
Copy link

aropan commented Apr 21, 2022

I think need to check monster position is outside before a base attraction.

while (!stop && turns < 8000) {
// Am I inside an attraction zone?
for (int idx = 0; idx < basePositions.size(); ++idx) {
Vector base = basePositions.get(idx);
if (cur.inRange(base, Configuration.BASE_ATTRACTION_RADIUS)) {
mob.status = new MobStatus(turns == 0 ? ATTACKING : WANDERING, gameManager.getPlayer(idx), turns);
stop = true;
break;
}
}
// Am I outside the map?
if (!insideMap(cur)) {
mob.status = new MobStatus(WANDERING, null, turns);
stop = true;
}

Reproduced error replay https://www.codingame.com/replay/621441027

@2StepsFr0mHell
Copy link

As discussed with aropan:
"See 32 frame.
Spider with id=21 has threatFor equal to 1.
And next frame go to outside."
so the spider is calculated as being a threat for the base but it won't have the time to be attracted as it will be out of the map already

@CGjupoulton CGjupoulton self-assigned this Apr 22, 2022
@CGjupoulton CGjupoulton added bug Something isn't working minor Minor issue labels Apr 22, 2022
@SimonFuet
Copy link
Contributor

Fixed, thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor Minor issue
Projects
None yet
Development

No branches or pull requests

4 participants