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.348 by root, Sat May 7 20:03:27 2011 UTC vs.
Revision 1.349 by root, Sun May 8 11:44:43 2011 UTC

2410 return /*who->flag [FLAG_WIZ]|| */ 2410 return /*who->flag [FLAG_WIZ]|| */
2411 (item->weight > 0 && !item->flag [FLAG_NO_PICK] && 2411 (item->weight > 0 && !item->flag [FLAG_NO_PICK] &&
2412 !item->flag [FLAG_ALIVE] && !item->invisible && (who->is_player () || item->weight < who->weight / 3)); 2412 !item->flag [FLAG_ALIVE] && !item->invisible && (who->is_player () || item->weight < who->weight / 3));
2413} 2413}
2414 2414
2415//-GPL
2416
2415/* 2417/*
2416 * create clone from object to another 2418 * create clone from object to another
2417 */ 2419 */
2418object * 2420object *
2419object::deep_clone () 2421object::deep_clone ()
2631object::region () const 2633object::region () const
2632{ 2634{
2633 return map ? map->region (x, y) 2635 return map ? map->region (x, y)
2634 : region::default_region (); 2636 : region::default_region ();
2635} 2637}
2638
2639//+GPL
2636 2640
2637void 2641void
2638object::open_container (object *new_container) 2642object::open_container (object *new_container)
2639{ 2643{
2640 if (container == new_container) 2644 if (container == new_container)
2698 } 2702 }
2699// else if (!old_container->env && contr && contr->ns) 2703// else if (!old_container->env && contr && contr->ns)
2700// contr->ns->floorbox_reset (); 2704// contr->ns->floorbox_reset ();
2701} 2705}
2702 2706
2707//-GPL
2708
2709// prefetch some flat area around the player
2710static void
2711prefetch_surrounding_area (object *op, maptile *map, int range)
2712{
2713 for (maprect *rect = map->split_to_tiles (mapwalk_buf,
2714 op->x - range , op->y - range ,
2715 op->x + range + 1, op->y + range + 1);
2716 rect->m;
2717 ++rect)
2718 {
2719 rect->m->touch ();
2720 rect->m->activate ();
2721 }
2722}
2723
2724// prefetch a generous area around the player, also up and down
2725void
2726object::prefetch_surrounding_maps ()
2727{
2728 prefetch_surrounding_area (this, map, 40);
2729
2730 if (maptile *m = map->tile_available (TILE_DOWN))
2731 prefetch_surrounding_area (this, m, 20);
2732
2733 if (maptile *m = map->tile_available (TILE_UP))
2734 prefetch_surrounding_area (this, m, 20);
2735}
2736
2737//+GPL
2738
2703object * 2739object *
2704object::force_find (shstr_tmp name) 2740object::force_find (shstr_tmp name)
2705{ 2741{
2706 /* cycle through his inventory to look for the MARK we want to 2742 /* cycle through his inventory to look for the MARK we want to
2707 * place 2743 * place
2711 return splay (tmp); 2747 return splay (tmp);
2712 2748
2713 return 0; 2749 return 0;
2714} 2750}
2715 2751
2716//-GPL
2717
2718void 2752void
2719object::force_set_timer (int duration) 2753object::force_set_timer (int duration)
2720{ 2754{
2721 this->duration = 1; 2755 this->duration = 1;
2722 this->speed_left = -1.f; 2756 this->speed_left = -1.f;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines