ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/cfperl.xs
(Generate patch)

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.192 by root, Tue Apr 17 20:41:15 2007 UTC vs.
Revision 1.193 by root, Thu Apr 19 16:23:48 2007 UTC

2008 sfree (THIS->regions, THIS->size ()); 2008 sfree (THIS->regions, THIS->size ());
2009 free (THIS->regionmap); 2009 free (THIS->regionmap);
2010 2010
2011 THIS->regions = regions; 2011 THIS->regions = regions;
2012 THIS->regionmap = regionmap; 2012 THIS->regionmap = regionmap;
2013}
2014
2015void
2016maptile::create_region_treasure ()
2017 CODE:
2018{
2019 object *op = object::create ();
2020 op->type = FLOOR;
2021 op->map = THIS;
2022
2023 for (int x = 0; x < THIS->width; ++x)
2024 for (int y = 0; y < THIS->height; ++y)
2025 {
2026 region *rgn = THIS->region (x, y);
2027
2028 //fprintf (stderr, "%d,%d %f %p\n", x, y, rgn->treasure_density,rgn->treasure);//D
2029 if (rgn->treasure && rndm () < rgn->treasure_density)
2030 {
2031 op->x = x;
2032 op->y = y;
2033 create_treasure (rgn->treasure, op, GT_ENVIRONMENT, THIS->difficulty);
2034 }
2035 }
2036
2037 op->destroy ();
2013} 2038}
2014 2039
2015void play_sound_map (maptile *map, int x, int y, int sound_num) 2040void play_sound_map (maptile *map, int x, int y, int sound_num)
2016 2041
2017int out_of_map (maptile *map, int x, int y) 2042int out_of_map (maptile *map, int x, int y)
2241 RETVAL = 0; 2266 RETVAL = 0;
2242 while (rgn = rgn->parent) 2267 while (rgn = rgn->parent)
2243 RETVAL++; 2268 RETVAL++;
2244 OUTPUT: RETVAL 2269 OUTPUT: RETVAL
2245 2270
2246INCLUDE: $PERL $srcdir/genacc region ../include/map.h | 2271INCLUDE: $PERL $srcdir/genacc region ../include/region.h |
2247 2272
2248MODULE = cf PACKAGE = cf::living 2273MODULE = cf PACKAGE = cf::living
2249 2274
2250INCLUDE: $PERL $srcdir/genacc living ../include/living.h | 2275INCLUDE: $PERL $srcdir/genacc living ../include/living.h |
2251 2276

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines