Fish breeder can't breed fish if the game is loaded after all fish is caught
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Medium
|
Unassigned |
Bug Description
How to reproduce:
* Start a new game for Atlanteans.
* Build a fisherman's house somewhere near water.
* Wait for the fisherman to catch all the fish he can.
* Save the game, end the game, then load the just saved game.
* Build a fish breeder's house next to the fisherman's house.
Expected result:
The fish breeder should begin breeding fish, and the fisherman should start catching it. This is what happens if the saving/loading step is omitted.
Actual result:
Both the fish breeder and the fisherman complain that they can't find any resource, and they don't work.
I think that this bug is caused by this piece of code [1]. When loading a game, it checks whether the amount of a resource is zero, and in this case sets its id and start_amount to zero as well. I think that this check is unnecessary and harmful, and should be removed completely. In any case, saving and then loading a game shouldn't change its behavior.
Related branches
- GunChleoc: Approve
- Klaus Halfmann: Approve (review, compile, testplay)
-
Diff: 44 lines (+3/-22)1 file modifiedsrc/map_io/map_resources_packet.cc (+3/-22)
Changed in widelands: | |
status: | Confirmed → Fix Committed |
Is this not an expected behavior? Fish breeder needs at least some fish on the field to breed additional fish.
Whether they complain or not is secondary. Are you sure that fish breeder breeds any fish before game save?