Page 1 of 1

(fixed) Monsters not found on center tile

Posted: Mon Nov 26, 2007 1:37 pm
by Remy
I noticed that the search_for_monster function (base\methods.lua:262) doesn't check the center tile position, and so monsters standing there are never found, which means alot of attacks miss them. This code added at around line 280 seems to fix it (I'm not yet fully caffienated, so I'm not sure if it's in the proper place):

Code: Select all

monster_id = search_for_type(lev, monx, mony, CENTER, "MONSTER")
if (monster_id) then
     return monster_id
end

Posted: Mon Nov 26, 2007 9:43 pm
by Sophia
I put in the check for CENTER a little above where you did (at around line 276), because I thought it'd make more sense to check the center before it checked a back tile.

In normal cases, this wouldn't matter, as they're supposedly mutually exclusive, but this way it's logical just in case someone is doing some kind of 5-monsters-on-a-tile hack-- and I know for a fact someone is ;)