← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~qcumber-some/widelands/lumberjack-vision into lp:widelands

 

Jens Beyer (Qcumber-some) has proposed merging lp:~qcumber-some/widelands/lumberjack-vision into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  #585107 Lumberjack ignores player's vision range
  https://bugs.launchpad.net/bugs/585107


worker command findobject targetting an immovable is now honoring the known map, so lumberjacks and stonemasons don't magically know about existing resources the player has not discovered yet.
-- 
https://code.launchpad.net/~qcumber-some/widelands/lumberjack-vision/+merge/39755
Your team Widelands Developers is requested to review the proposed merge of lp:~qcumber-some/widelands/lumberjack-vision into lp:widelands.
=== modified file 'src/logic/worker.cc'
--- src/logic/worker.cc	2010-11-01 13:12:23 +0000
+++ src/logic/worker.cc	2010-11-01 15:58:49 +0000
@@ -404,6 +404,15 @@
 						found_reserved = true;
 						list.erase(list.begin() + idx);
 					}
+					else
+					{
+						Coords const coord = imm->get_position();
+						Map_Index mapidx = map.get_index(coord, map.get_width());
+						Vision const visible = owner().vision(mapidx);
+						if (!visible) {
+							list.erase(list.begin() + idx);
+						}
+					}
 				}
 			}