"Out of resources" messages should be triggered by productivity
Bug #1454371 reported by
GunChleoc
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Except for mines, "Out of Resources" messages are triggered by Worker:
This is fine for quarries etc (basically, for buildings that have their delay_attempts = 0 in the conf. For other production sites, this is not as useful as it should be.
So, we should hook the triggering of this message into the site's productivity instead.
Related forum topic: https:/
Related branches
lp:~widelands-dev/widelands/bug-1454371
- Widelands Developers: Pending requested
-
Diff: 455 lines (+46/-46)26 files modifiedsrc/chat/chat.h (+1/-1)
src/graphic/graphic.h (+1/-1)
src/logic/editor_game_base.h (+1/-1)
src/logic/immovable.h (+1/-1)
src/logic/map.h (+1/-1)
src/logic/productionsite.cc (+13/-14)
src/logic/productionsite.h (+6/-5)
src/logic/ship.h (+1/-1)
src/notifications/notifications.h (+2/-2)
src/notifications/test/notifications_test.cc (+1/-1)
src/wui/logmessage.h (+1/-1)
tribes/atlanteans/blackroot_farm/conf (+1/-1)
tribes/atlanteans/farm/conf (+1/-1)
tribes/atlanteans/hunters_house/conf (+1/-1)
tribes/atlanteans/well/conf (+1/-1)
tribes/atlanteans/woodcutters_house/conf (+1/-1)
tribes/barbarians/farm/conf (+3/-3)
tribes/barbarians/hunters_hut/conf (+1/-1)
tribes/barbarians/lumberjacks_hut/conf (+1/-1)
tribes/barbarians/reed_yard/conf (+1/-1)
tribes/barbarians/well/conf (+1/-1)
tribes/empire/farm/conf (+1/-1)
tribes/empire/hunters_house/conf (+1/-1)
tribes/empire/lumberjacks_house/conf (+1/-1)
tribes/empire/vineyard/conf (+1/-1)
tribes/empire/well/conf (+1/-1)
Changed in widelands: | |
status: | New → In Progress |
assignee: | nobody → GunChleoc (gunchleoc) |
Changed in widelands: | |
status: | Fix Committed → In Progress |
milestone: | none → build19-rc1 |
Changed in widelands: | |
assignee: | GunChleoc (gunchleoc) → nobody |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I would leave it as is but with one modification.
There is m_out_of_ resource_ delay_counter counter increased by 1 with each notify_player call (when resource is not found). It is zeroed only after publishing the message, when treshold (out_of_ resource_ delay_attempts, f.e. 10) is achieved.
For productionsites with non-renewable resources (stones, fish, undeground raw materials) - it is fine, but farmers, cutters have renewable/ reappearable resources. So I suggest to just to zero the counter when a resource is found (unnotify_player() is called).
Should not have negative impact on mines and alike....
I am running some tests, it looks that is works as intended....