ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.C
(Generate patch)

Comparing deliantra/server/common/object.C (file contents):
Revision 1.188 by root, Wed Sep 12 11:10:09 2007 UTC vs.
Revision 1.190 by root, Sat Sep 15 15:58:06 2007 UTC

1991 * customized, changed states, etc. 1991 * customized, changed states, etc.
1992 */ 1992 */
1993int 1993int
1994find_free_spot (const object *ob, maptile *m, int x, int y, int start, int stop) 1994find_free_spot (const object *ob, maptile *m, int x, int y, int start, int stop)
1995{ 1995{
1996 int altern[SIZEOFFREE];
1996 int index = 0, flag; 1997 int index = 0, flag;
1997 int altern[SIZEOFFREE];
1998 1998
1999 for (int i = start; i < stop; i++) 1999 for (int i = start; i < stop; i++)
2000 { 2000 {
2001 mapxy pos (m, x, y); pos.move (i); 2001 mapxy pos (m, x, y); pos.move (i);
2002 2002
2003 if (!pos.normalise ()) 2003 if (!pos.normalise ())
2004 continue; 2004 continue;
2005 2005
2006 mapspace &ms = *pos; 2006 mapspace &ms = *pos;
2007 ms.update (); 2007
2008 if (ms.flags () & P_IS_ALIVE)
2009 continue;
2008 2010
2009 /* However, often 2011 /* However, often
2010 * ob doesn't have any move type (when used to place exits) 2012 * ob doesn't have any move type (when used to place exits)
2011 * so the AND operation in OB_TYPE_MOVE_BLOCK doesn't work. 2013 * so the AND operation in OB_TYPE_MOVE_BLOCK doesn't work.
2012 */ 2014 */
2013 if (ob->move_type == 0 && ms.move_block != MOVE_ALL) 2015 if (ob->move_type == 0 && ms.move_block != MOVE_ALL)
2016 {
2017 altern [index++] = i;
2014 continue; 2018 continue;
2019 }
2015 2020
2016 /* Basically, if we find a wall on a space, we cut down the search size. 2021 /* Basically, if we find a wall on a space, we cut down the search size.
2017 * In this way, we won't return spaces that are on another side of a wall. 2022 * In this way, we won't return spaces that are on another side of a wall.
2018 * This mostly work, but it cuts down the search size in all directions - 2023 * This mostly work, but it cuts down the search size in all directions -
2019 * if the space being examined only has a wall to the north and empty 2024 * if the space being examined only has a wall to the north and empty

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines