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.300 by root, Sun Sep 21 23:21:49 2008 UTC vs.
Revision 1.302 by root, Mon Sep 22 23:57:48 2008 UTC

2395} 2395}
2396 2396
2397void 2397void
2398maptile::create_region_treasure () 2398maptile::create_region_treasure ()
2399 CODE: 2399 CODE:
2400{
2401 object *op = object::create ();
2402 op->type = FLOOR;
2403 op->map = THIS;
2404
2405 for (int x = 0; x < THIS->width; ++x) 2400 for (int x = 0; x < THIS->width; ++x)
2406 for (int y = 0; y < THIS->height; ++y) 2401 for (int y = 0; y < THIS->height; ++y)
2407 { 2402 {
2408 region *rgn = THIS->region (x, y); 2403 region *rgn = THIS->region (x, y);
2409 2404
2410 //fprintf (stderr, "%d,%d %f %p\n", x, y, rgn->treasure_density,rgn->treasure);//D 2405 //fprintf (stderr, "%d,%d %f %p\n", x, y, rgn->treasure_density,rgn->treasure);//D
2406 if (object *op = THIS->at (x, y).top)
2411 if (rgn->treasure && rndm () < rgn->treasure_density) 2407 if (rgn->treasure && rndm () < rgn->treasure_density)
2412 {
2413 op->x = x;
2414 op->y = y;
2415 create_treasure (rgn->treasure, op, GT_ENVIRONMENT, THIS->difficulty); 2408 create_treasure (rgn->treasure, op, GT_ENVIRONMENT, THIS->difficulty);
2416 }
2417 } 2409 }
2418
2419 op->destroy ();
2420}
2421 2410
2422int out_of_map (maptile *map, int x, int y) 2411int out_of_map (maptile *map, int x, int y)
2423 2412
2424void 2413void
2425trigger (maptile *map, long connection, bool state = true) 2414trigger (maptile *map, long connection, bool state = true)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines