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

Comparing deliantra/server/random_maps/treasure.C (file contents):
Revision 1.16 by root, Mon Jan 15 01:55:22 2007 UTC vs.
Revision 1.17 by root, Mon Jan 15 15:54:19 2007 UTC

212 if (i == -1) 212 if (i == -1)
213 { 213 {
214 the_chest->destroy (); 214 the_chest->destroy ();
215 return NULL; 215 return NULL;
216 } 216 }
217
217 xl = x + freearr_x[i]; 218 xl = x + freearr_x[i];
218 yl = y + freearr_y[i]; 219 yl = y + freearr_y[i];
219 220
220 /* if the placement is blocked, return a fail. */ 221 /* if the placement is blocked, return a fail. */
221 if (wall_blocked (map, xl, yl)) 222 if (wall_blocked (map, xl, yl))
656 *cy = ly; 657 *cy = ly;
657 return; 658 return;
658 } 659 }
659 } 660 }
660 /* give up and return the closest free spot. */ 661 /* give up and return the closest free spot. */
661 i = find_first_free_spot (&archetype::find ("chest")->clone, map, x, y); 662 i = find_free_spot (&archetype::find ("chest")->clone, map, x, y, 1, SIZEOFFREE1 + 1);
662 if (i != -1 && i <= SIZEOFFREE1) 663
664 if (i != -1)
663 { 665 {
664 *cx = x + freearr_x[i]; 666 *cx = x + freearr_x[i];
665 *cy = y + freearr_y[i]; 667 *cy = y + freearr_y[i];
666 return; 668 }
669 else
667 } 670 {
668 /* indicate failure */ 671 /* indicate failure */
672 *cx = -1;
669 *cx = *cy = -1; 673 *cy = -1;
674 }
670} 675}
671 676
672 677
673void 678void
674remove_monsters (int x, int y, maptile *map) 679remove_monsters (int x, int y, maptile *map)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines