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

Comparing deliantra/server/common/map.C (file contents):
Revision 1.140 by root, Sun May 4 20:40:52 2008 UTC vs.
Revision 1.142 by root, Sun May 18 17:52:53 2008 UTC

641 case KW_sky: thawer.get (sky); break; 641 case KW_sky: thawer.get (sky); break;
642 642
643 case KW_per_player: thawer.get (per_player); break; 643 case KW_per_player: thawer.get (per_player); break;
644 case KW_per_party: thawer.get (per_party); break; 644 case KW_per_party: thawer.get (per_party); break;
645 case KW_no_reset: thawer.get (no_reset); break; 645 case KW_no_reset: thawer.get (no_reset); break;
646 case KW_no_drop: thawer.get (no_drop); break;
646 647
647 case KW_region: default_region = region::find (thawer.get_str ()); break; 648 case KW_region: default_region = region::find (thawer.get_str ()); break;
648 case KW_shopitems: shopitems = parse_shop_string (thawer.get_str ()); break; 649 case KW_shopitems: shopitems = parse_shop_string (thawer.get_str ()); break;
649 650
650 // old names new names 651 // old names new names
724 MAP_OUT (swap_time); 725 MAP_OUT (swap_time);
725 MAP_OUT (reset_time); 726 MAP_OUT (reset_time);
726 MAP_OUT (reset_timeout); 727 MAP_OUT (reset_timeout);
727 MAP_OUT (fixed_resettime); 728 MAP_OUT (fixed_resettime);
728 MAP_OUT (no_reset); 729 MAP_OUT (no_reset);
730 MAP_OUT (no_drop);
729 MAP_OUT (difficulty); 731 MAP_OUT (difficulty);
730 732
731 if (default_region) MAP_OUT2 (region, default_region->name); 733 if (default_region) MAP_OUT2 (region, default_region->name);
732 734
733 if (shopitems) 735 if (shopitems)
1040 else 1042 else
1041 darkness = new_level; 1043 darkness = new_level;
1042 1044
1043 /* All clients need to get re-updated for the change */ 1045 /* All clients need to get re-updated for the change */
1044 update_all_map_los (this); 1046 update_all_map_los (this);
1047
1045 return 1; 1048 return 1;
1046} 1049}
1047 1050
1048/* 1051/*
1049 * This function updates various attributes about a specific space 1052 * This function updates various attributes about a specific space
1052 * through, etc) 1055 * through, etc)
1053 */ 1056 */
1054void 1057void
1055mapspace::update_ () 1058mapspace::update_ ()
1056{ 1059{
1057 object *tmp, *last = 0; 1060 object *last = 0;
1058 uint8 flags = P_UPTODATE, light = 0, anywhere = 0; 1061 uint8 flags = P_UPTODATE, light = 0, anywhere = 0;
1059 MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0; 1062 MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0;
1060 1063
1061 //object *middle = 0; 1064 //object *middle = 0;
1062 //object *top = 0; 1065 //object *top = 0;
1064 // this seems to generate better code than using locals, above 1067 // this seems to generate better code than using locals, above
1065 object *&top = faces_obj[0] = 0; 1068 object *&top = faces_obj[0] = 0;
1066 object *&middle = faces_obj[1] = 0; 1069 object *&middle = faces_obj[1] = 0;
1067 object *&floor = faces_obj[2] = 0; 1070 object *&floor = faces_obj[2] = 0;
1068 1071
1069 for (tmp = bot; tmp; last = tmp, tmp = tmp->above) 1072 for (object *tmp = bot; tmp; last = tmp, tmp = tmp->above)
1070 { 1073 {
1071 /* This could be made additive I guess (two lights better than 1074 /* This could be made additive I guess (two lights better than
1072 * one). But if so, it shouldn't be a simple additive - 2 1075 * one). But if so, it shouldn't be a simple additive - 2
1073 * light bulbs do not illuminate twice as far as once since 1076 * light bulbs do not illuminate twice as far as once since
1074 * it is a dissapation factor that is cubed. 1077 * it is a dissapation factor that is cubed.
1158 * 1) top face is set, need middle to be set. 1161 * 1) top face is set, need middle to be set.
1159 * 2) middle is set, need to set top. 1162 * 2) middle is set, need to set top.
1160 * 3) neither middle or top is set - need to set both. 1163 * 3) neither middle or top is set - need to set both.
1161 */ 1164 */
1162 1165
1163 for (tmp = last; tmp; tmp = tmp->below) 1166 for (object *tmp = last; tmp; tmp = tmp->below)
1164 { 1167 {
1165 /* Once we get to a floor, stop, since we already have a floor object */ 1168 /* Once we get to a floor, stop, since we already have a floor object */
1166 if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) 1169 if (QUERY_FLAG (tmp, FLAG_IS_FLOOR))
1167 break; 1170 break;
1168 1171
1571} 1574}
1572 1575
1573object * 1576object *
1574maptile::insert (object *op, int x, int y, object *originator, int flags) 1577maptile::insert (object *op, int x, int y, object *originator, int flags)
1575{ 1578{
1576 if (!op->flag [FLAG_REMOVED])
1577 op->remove ();
1578
1579 return insert_ob_in_map_at (op, this, originator, flags, x, y); 1579 return insert_ob_in_map_at (op, this, originator, flags, x, y);
1580} 1580}
1581 1581
1582region * 1582region *
1583maptile::region (int x, int y) const 1583maptile::region (int x, int y) const

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines