Skip to content

fixed emergency protocol by removing sheduled wares requested before ...#1961

Open
tost11 wants to merge 9 commits into
Return-To-The-Roots:masterfrom
tost11:feature/fix-emergency-protocol
Open

fixed emergency protocol by removing sheduled wares requested before ...#1961
tost11 wants to merge 9 commits into
Return-To-The-Roots:masterfrom
tost11:feature/fix-emergency-protocol

Conversation

@tost11

@tost11 tost11 commented Jul 16, 2026

Copy link
Copy Markdown

When emergency protocol is activated and many buildings are already planned, the wares already scheduled for delivery are ignoring the protocol.

So now when emergency protocol is activated, those wares get removed (if not for the sawmill or woodcutter).

This also solved the issue for AI enemies on very low resources where they're not able to start because the first sawmill never got built.

Comment thread libs/s25main/GamePlayer.cpp Outdated
Comment thread libs/s25main/GamePlayer.h Outdated
Comment thread libs/s25main/GamePlayer.cpp Outdated
Comment thread libs/s25main/GamePlayer.h Outdated
Comment thread libs/s25main/GamePlayer.cpp Outdated
Comment thread libs/s25main/GamePlayer.cpp Outdated

@Flamefire Flamefire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
trivial style issue in the NULL check which I fixed directly. git pull if you need to do further changes

@Flamefire
Flamefire enabled auto-merge July 17, 2026 10:29

@Flamefire Flamefire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to run clang-format first. If you have it installed when configuring you can run e.g. make clangFormat
Or use the diff as shown in the CI job.

Can you add a test for that? Might be a bit tricky though

auto-merge was automatically disabled July 17, 2026 22:53

Head branch was pushed to by a user without write access

@tost11
tost11 force-pushed the feature/fix-emergency-protocol branch from bc104e8 to 689112e Compare July 17, 2026 23:02
Flamefire
Flamefire previously approved these changes Jul 18, 2026
@Spikeone

Spikeone commented Jul 19, 2026

Copy link
Copy Markdown
Member

Well, this is original behavior - you were also able to store out wares to get them going anway (a tactic used with very low goods frequently). This fix breaks this original behavior, doesn't it?

This sounds reading your description more like a problem the AI has, and should be fixed for the AI instead of for players (maybe the AI can use that system which is slight cheating but I'd opt for a smarter AI instead of an AI playing only by rules)

@Flamefire

Copy link
Copy Markdown
Member

Well, this is original behavior - you were also able to store out wares to get them going anway (a tactic used with very low goods frequently). This fix breaks this original behavior, doesn't it?

What we have:

  • When emergency program is active newly built buildings don't get wares except woodcutter or sawmills
  • With this: Additionally wares ordered for such "blocked" buildings which are still in a warehouse, i.e. not carried out yet, are stopped, wares already on the way are not.

Not fully sure how the original handled that as it seems like a minor corner case happening rarely.
If in the original wares for other buildings are still carried out, then I'd also say that we guard this behavior for AI only. If it helps then I don't see an issue there as it is such a minimal QoL change for rare cases that it likely won't even be noticed in most cases.

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

Successfully merging this pull request may close these issues.

3 participants