Closed stefson closed 2 weeks ago
it crashes here: https://github.com/Return-To-The-Roots/s25client/blob/7bf8281a41e094ad1aa43d574da489a13afe1958/libs/s25main/world/World.cpp#L163-L165
so it looks like the resource point is empty?!?
I see what the problem is: nofFarmhand
searches for a work point where the fisher should go by using GetPointQuality
. If it found one it reserves the point such that no other figure can work there.
However for fishers they need an adjacent fish, so the point where they work (from) is not relevant.
I assume what happens:
For the animation we need to know whether it will be successful when the work starts, i.e. when the fisher arrives.
A related issue I see is that nofFarmhand
doesn't check whether the point is valid when it arrives: https://github.com/Return-To-The-Roots/s25client/blob/7bf8281a41e094ad1aa43d574da489a13afe1958/libs/s25main/figures/nofFarmhand.cpp#L208-L219
That doesn't help much in this case because the point becomes invalid after the worker has arrived & started.
Solutions:
The first might look odd as the fisher turns around just after arrival, but he might turn around at any other point along the way either.
The 2nd is inconsistent and might hide other issues where the point becomes invalid just before/at arrival (for any farmhand).
The 3rd draws catching a fish but then produces none.
The last one disallows 2 fishers next to each other even if there is enough fish.
--> The first is the most sensible IMO. Only minor issue: If the building gets destroyed while the fisher is still fishing he aborts but the fish is lost. I'd say: Whatever!
the backtrace:
the replay: 2024-06-16_16-19-11.zip
also happened during an attack, maybe related to #1668