Lua: reveal_fields after hide_fields(fields, hide_completely) does not respect seen fields
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Since there is a possibility to hide a area of map completely, revealing after a complete hiding causes unwanted behavior. Some parts of a map get darken and workers disappear. Difficult to explain so please try yourself: The attached save game is from tutorial03_
plr:hide_
plr:reveal_
sleep(600000)
Watch the region at the Quarry at 45,54 (increase game time to 3 or so). Each time the Stonemason leaves his house some area around the quarry get darken. This happens also to other parts of the map. Some carriers do also disappear. I guess its because the player looses sight to the area where the carrier stands (the area get a bit darken).
Maybe an opposite option in regard to hide_fields(fields, hide_completly) would be needed to reveal_fields()? Something like reveal_
Related branches
- kaputtnik (community): Approve (testing)
- GunChleoc: Needs Resubmitting
-
Diff: 652 lines (+237/-137)8 files modifiedsrc/logic/CMakeLists.txt (+1/-0)
src/logic/player.cc (+58/-23)
src/logic/player.h (+17/-18)
src/logic/see_unsee_node.h (+26/-0)
src/map_io/map_players_view_packet.cc (+35/-2)
src/scripting/lua_game.cc (+15/-18)
test/maps/lua_testsuite.wmf/scripting/gplayer.lua (+0/-76)
test/maps/plain.wmf/scripting/test_player_vision.lua (+85/-0)
- GunChleoc: Approve
-
Diff: 784 lines (+283/-107)22 files modifieddata/campaigns/bar01.wmf/scripting/init.lua (+1/-0)
data/campaigns/bar01.wmf/scripting/mission_thread.lua (+8/-3)
data/campaigns/bar01.wmf/scripting/texts.lua (+0/-3)
data/campaigns/bar02.wmf/scripting/mission_thread.lua (+21/-9)
data/campaigns/bar02.wmf/scripting/texts.lua (+1/-0)
data/campaigns/emp01.wmf/scripting/mission_thread.lua (+10/-6)
data/campaigns/emp02.wmf/scripting/mission_thread.lua (+11/-12)
data/campaigns/emp02.wmf/scripting/texts.lua (+5/-0)
data/campaigns/emp03.wmf/scripting/helper_functions.lua (+0/-53)
data/campaigns/emp03.wmf/scripting/mission_thread.lua (+6/-5)
data/campaigns/tutorial01_basic_control.wmf/scripting/init.lua (+1/-0)
data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua (+1/-0)
data/campaigns/tutorial02_warfare.wmf/scripting/init.lua (+1/-0)
data/campaigns/tutorial02_warfare.wmf/scripting/mission_thread.lua (+1/-0)
data/campaigns/tutorial03_seafaring.wmf/scripting/init.lua (+1/-0)
data/campaigns/tutorial03_seafaring.wmf/scripting/mission_thread.lua (+2/-0)
data/campaigns/tutorial04_economy.wmf/scripting/init.lua (+1/-0)
data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua (+6/-2)
data/campaigns/tutorial04_economy.wmf/scripting/starting_conditions.lua (+23/-10)
data/scripting/field_animations.lua (+173/-0)
data/scripting/infrastructure.lua (+4/-1)
src/scripting/lua_game.cc (+6/-3)
Changed in widelands: | |
milestone: | none → build20-rc1 |
Changed in widelands: | |
assignee: | nobody → GunChleoc (gunchleoc) |
status: | New → In Progress |
tags: | added: lua |
Changed in widelands: | |
status: | In Progress → Fix Committed |
assignee: | GunChleoc (gunchleoc) → nobody |
Attached screenshot shows behaviour of attached branch for the following code in the seafaring tutorial.
plr:reveal_ fields( wl.Game( ).map:get_ field(70, 46):region( 20)) fields( wl.Game( ).map:get_ field(70, 46):region( 10)) fields( wl.Game( ).map:get_ field(70, 46):region( 5),true)
plr:hide_
plr:hide_