Imperial sentry returns more wares when dismantled than it needed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
High
|
cghislai |
Bug Description
Build costs: 1 stone, 1 trunk, 1 wood (short: 1s, 1t, 1w)
Returned when dismantled: 1s, 1t, 2w
I think this is because the sentry is an enhanced building (from the barrack), so the build costs of the two buildings are added:
Barrack: 1t, 2w + Sentry: 1s, 1t, 1w = 1s, 2t, 3w
These values are divided by two and rounded up to calculate the returned resources. This gives 1s, 1t, 2w, as observed.
The same issue appears for the Imperial barrier (costs: 2s, 2t, 2w, 1 marble) because of the outpost (costs: 1s, 1t, 1w, 1m). Added, it is 3s, 3t, 3w, 2m, which leads to 2s, 2t, 2w, 1m when dismantling. These are the actual build costs (although it should be 1s, 1t, 1w, 1m).
These are the only two buildings where the problem appears because the are buildable directly (using less resources) and via upgrade (using additional resources for the lower building), but return the same wares in both cases.
Related branches
- SirVer: Approve
-
Diff: 3061 lines (+867/-155)144 files modifiedsrc/logic/building.cc (+20/-11)
src/logic/building.h (+45/-6)
src/logic/constructionsite.cc (+18/-23)
src/logic/constructionsite.h (+0/-3)
src/logic/dismantlesite.cc (+19/-26)
src/logic/dismantlesite.h (+2/-3)
src/logic/editor_game_base.cc (+10/-6)
src/logic/editor_game_base.h (+7/-4)
src/logic/player.cc (+3/-4)
src/map_io/widelands_map_building_data_packet.cc (+10/-6)
src/map_io/widelands_map_buildingdata_data_packet.cc (+93/-32)
src/map_io/widelands_map_buildingdata_data_packet.h (+3/-0)
src/wui/buildingwindow.cc (+3/-2)
tribes/atlanteans/armoursmithy/conf (+5/-0)
tribes/atlanteans/bakery/conf (+4/-0)
tribes/atlanteans/blackroot_farm/conf (+5/-0)
tribes/atlanteans/burners_house/conf (+4/-0)
tribes/atlanteans/castle/conf (+5/-0)
tribes/atlanteans/coalmine/conf (+4/-0)
tribes/atlanteans/crystalmine/conf (+4/-0)
tribes/atlanteans/dungeon/conf (+8/-0)
tribes/atlanteans/farm/conf (+5/-0)
tribes/atlanteans/fish_breeders_house/conf (+3/-0)
tribes/atlanteans/fishers_house/conf (+3/-0)
tribes/atlanteans/foresters_house/conf (+4/-0)
tribes/atlanteans/goldmine/conf (+4/-0)
tribes/atlanteans/goldweaver/conf (+4/-0)
tribes/atlanteans/guardhall/conf (+5/-0)
tribes/atlanteans/guardhouse/conf (+3/-0)
tribes/atlanteans/high_tower/conf (+4/-1)
tribes/atlanteans/horsefarm/conf (+4/-0)
tribes/atlanteans/hunters_house/conf (+3/-0)
tribes/atlanteans/ironmine/conf (+4/-0)
tribes/atlanteans/labyrinth/conf (+8/-0)
tribes/atlanteans/mill/conf (+5/-0)
tribes/atlanteans/port/conf (+7/-0)
tribes/atlanteans/quarry/conf (+3/-0)
tribes/atlanteans/sawmill/conf (+4/-0)
tribes/atlanteans/scouts_house/conf (+3/-0)
tribes/atlanteans/shipyard/conf (+6/-0)
tribes/atlanteans/small_tower/conf (+4/-0)
tribes/atlanteans/smelting_works/conf (+3/-0)
tribes/atlanteans/smokery/conf (+3/-0)
tribes/atlanteans/spiderfarm/conf (+4/-0)
tribes/atlanteans/toolsmithy/conf (+4/-0)
tribes/atlanteans/tower/conf (+5/-0)
tribes/atlanteans/warehouse/conf (+6/-0)
tribes/atlanteans/weaponsmithy/conf (+5/-0)
tribes/atlanteans/weaving-mill/conf (+5/-0)
tribes/atlanteans/well/conf (+4/-0)
tribes/atlanteans/woodcutters_house/conf (+4/-0)
tribes/barbarians/axefactory/conf (+6/-1)
tribes/barbarians/bakery/conf (+5/-0)
tribes/barbarians/barrier/conf (+4/-0)
tribes/barbarians/battlearena/conf (+7/-0)
tribes/barbarians/big_inn/conf (+4/-1)
tribes/barbarians/brewery/conf (+5/-1)
tribes/barbarians/burners_house/conf (+4/-0)
tribes/barbarians/cattlefarm/conf (+4/-0)
tribes/barbarians/citadel/conf (+7/-1)
tribes/barbarians/coalmine/conf (+4/-0)
tribes/barbarians/deep_coalmine/conf (+5/-1)
tribes/barbarians/deep_goldmine/conf (+5/-1)
tribes/barbarians/deep_oremine/conf (+5/-1)
tribes/barbarians/deeper_coalmine/conf (+5/-1)
tribes/barbarians/deeper_goldmine/conf (+5/-1)
tribes/barbarians/deeper_oremine/conf (+5/-1)
tribes/barbarians/donjon/conf (+4/-0)
tribes/barbarians/farm/conf (+5/-0)
tribes/barbarians/fernery/conf (+4/-0)
tribes/barbarians/fishers_hut/conf (+3/-0)
tribes/barbarians/fortress/conf (+6/-0)
tribes/barbarians/gamekeepers_hut/conf (+4/-0)
tribes/barbarians/goldmine/conf (+4/-0)
tribes/barbarians/granitemine/conf (+4/-0)
tribes/barbarians/hardener/conf (+4/-0)
tribes/barbarians/helmsmithy/conf (+6/-0)
tribes/barbarians/hunters_hut/conf (+4/-0)
tribes/barbarians/inn/conf (+5/-1)
tribes/barbarians/lime_kiln/conf (+4/-0)
tribes/barbarians/lumberjacks_hut/conf (+3/-0)
tribes/barbarians/metalworks/conf (+5/-0)
tribes/barbarians/micro-brewery/conf (+5/-0)
tribes/barbarians/oremine/conf (+4/-0)
tribes/barbarians/port/conf (+9/-0)
tribes/barbarians/quarry/conf (+5/-2)
tribes/barbarians/rangers_hut/conf (+3/-0)
tribes/barbarians/scouts_hut/conf (+4/-0)
tribes/barbarians/sentry/conf (+3/-0)
tribes/barbarians/shipyard/conf (+5/-0)
tribes/barbarians/smelting_works/conf (+5/-0)
tribes/barbarians/tavern/conf (+5/-0)
tribes/barbarians/trainingscamp/conf (+6/-0)
tribes/barbarians/warehouse/conf (+6/-0)
tribes/barbarians/warmill/conf (+6/-1)
tribes/barbarians/weaving-mill/conf (+4/-0)
tribes/barbarians/well/conf (+3/-0)
tribes/empire/arena/conf (+15/-7)
tribes/empire/armoursmithy/conf (+5/-0)
tribes/empire/bakery/conf (+4/-0)
tribes/empire/barracks/conf (+3/-0)
tribes/empire/barrier/conf (+15/-0)
tribes/empire/brewery/conf (+4/-0)
tribes/empire/burners_house/conf (+5/-0)
tribes/empire/castle/conf (+7/-1)
tribes/empire/coalmine/conf (+4/-0)
tribes/empire/colosseum/conf (+8/-1)
tribes/empire/deep_coalmine/conf (+5/-1)
tribes/empire/deep_goldmine/conf (+5/-1)
tribes/empire/deep_marblemine/conf (+5/-1)
tribes/empire/deep_oremine/conf (+5/-1)
tribes/empire/donkeyfarm/conf (+4/-0)
tribes/empire/farm/conf (+6/-0)
tribes/empire/fishers_house/conf (+3/-0)
tribes/empire/foresters_house/conf (+4/-0)
tribes/empire/fortress/conf (+7/-0)
tribes/empire/goldmine/conf (+4/-0)
tribes/empire/hunters_house/conf (+3/-0)
tribes/empire/inn/conf (+5/-1)
tribes/empire/lumberjacks_house/conf (+4/-0)
tribes/empire/marblemine/conf (+4/-0)
tribes/empire/mill/conf (+5/-0)
tribes/empire/oremine/conf (+4/-0)
tribes/empire/outpost/conf (+4/-0)
tribes/empire/piggery/conf (+5/-0)
tribes/empire/port/conf (+8/-0)
tribes/empire/quarry/conf (+3/-0)
tribes/empire/sawmill/conf (+4/-0)
tribes/empire/scouts_house/conf (+3/-0)
tribes/empire/sentry/conf (+11/-0)
tribes/empire/sheepfarm/conf (+4/-0)
tribes/empire/shipyard/conf (+5/-0)
tribes/empire/smelting_works/conf (+4/-0)
tribes/empire/stonemasons_house/conf (+4/-0)
tribes/empire/tavern/conf (+5/-0)
tribes/empire/toolsmithy/conf (+4/-0)
tribes/empire/tower/conf (+5/-0)
tribes/empire/trainingscamp/conf (+7/-0)
tribes/empire/vineyard/conf (+4/-0)
tribes/empire/warehouse/conf (+6/-0)
tribes/empire/weaponsmithy/conf (+6/-0)
tribes/empire/weaving-mill/conf (+4/-0)
tribes/empire/well/conf (+4/-0)
tribes/empire/winery/conf (+5/-0)
tags: | added: empire |
summary: |
- Imperial sentry returns more wares when dismatled than it needed + Imperial sentry returns more wares when dismantled than it needed |
Changed in widelands: | |
milestone: | none → build18-rc1 |
Changed in widelands: | |
status: | Triaged → In Progress |
Changed in widelands: | |
status: | In Progress → Fix Committed |
Should all upgraded buildings only return resources relative to the last upgrade step? Or should there be a special case for upgraded buildings that can be built directly? Discuss.