[crossfire] [patch] fix inconstency between on_same_map and get_rangevector

Andreas Kirschbaum kirschbaum at myrealbox.com
Thu Feb 9 15:42:05 CST 2006


Pippijn van Steenhoven wrote:
> while working on a script that would move an NPC, one bug was found in
> common/map.c. A diff is supplied at the following URL:
> http://data.plan9.de/adjacent.txt
> Basically, it's get_nearest_player which calls can_detect_enemy which then
> calls on_same_map and if that returns yes, it returns random crap.

Thanks for the bugfix; I did apply the (modified) patch.


Please add future patches to the Sourceforge tracker since patches sent
to the mailing list have a high chance to be missed. Patches added to
the tracker stay there until somebody looks at them.


Some notes about the patch:

 - Please try to follow Ansi C (C89). This especially means that //
   comments are not acceptable.

 - I did rewrite parts of the code: it did contain lines like

       *dx = MAP_HEIGHT(...)

   which cannot be correct.

 - I did not had a map to check, but I think it now can handle tiled
   maps with differing sizes. (For example a 20x50 map tiled to a 50x50
   map.)



More information about the crossfire mailing list