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

issue with Game::remove_road_forwards resulting in missing transporter #513

Open
tlongstretch opened this issue Jan 7, 2023 · 0 comments

Comments

@tlongstretch
Copy link

I could never figure out the actual cause of this, but it was frequently setting serfs to Lost state and resulting in no transporter at the flag, breaking the player's economy. Simply disabling the set_lost_state seems to fix the problem, whatever the cause. I have been running this way since 2021 and haven't ever seen an issue as a result of skipping the set_lost_state call.

if (map->has_serf(pos)) {
  Serf *serf = get_serf_at_pos(pos);
  if (!map->has_flag(pos)) {
    serf->set_lost_state();
  } else {
    /* Handle serf close to flag, where
       it should only be lost if walking
       in the wrong direction. */
    int d = serf->get_walking_dir();
    if (d < 0) d += 6;
    if (d == reverse_direction(dir)) {
      //serf->set_lost_state();  // commenting this out appears to fix the problem with no side effects
    }
  }
}
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