Calculations for Territorial winconditions are wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I noticed this while testing some changes I made. I played the map Crater against a computer. According to the normal stats had almost 2000 field units. But in the win-condition calculations is was only 1600. Although he had more then 50% of the total map (1724 was the 50% mark) He still wasn't winning.
This can easily be tested create an empty map with only 1 Player in the editor. Open the map in MP with Territorial.
The normal stats say 271 but the win conditions report only 264.
The problem is that the win conditions use only the buildable fields for calculation and not the fields a player actually owns. So fields that are occupied by buildings, mountains, immovables and so on are not considered for calculation.
Related branches
- hessenfarmer: Approve
- GunChleoc: Approve
- Toni Förster: Approve (testing)
- kaputtnik (community): Approve (testing)
-
Diff: 962 lines (+428/-112)16 files modifieddata/scripting/win_conditions/artifacts.lua (+17/-16)
data/scripting/win_conditions/territorial_functions.lua (+0/-23)
data/scripting/win_conditions/territorial_lord.lua (+8/-3)
data/scripting/win_conditions/territorial_time.lua (+6/-3)
data/scripting/win_conditions/wood_gnome.lua (+9/-15)
src/logic/field.h (+6/-2)
src/logic/game.cc (+19/-3)
src/logic/game.h (+5/-0)
src/logic/map.cc (+111/-3)
src/logic/map.h (+6/-0)
src/logic/replay.cc (+0/-1)
src/scripting/lua_map.cc (+149/-38)
src/scripting/lua_map.h (+4/-0)
src/wui/interactive_gamebase.cc (+2/-0)
test/maps/lua_testsuite.wmf/scripting/cfield.lua (+78/-5)
test/maps/two_ponds.wmf/scripting/test_seafaring.lua (+8/-0)
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in widelands: | |
assignee: | nobody → Toni Förster (stonerl) |
status: | New → In Progress |
Changed in widelands: | |
milestone: | none → build20-rc1 |
status: | In Progress → Fix Committed |
tags: | added: wincondition |
See also bug 1622307, and bug 1617576