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.139 by root, Sun May 4 19:14:23 2008 UTC vs.
Revision 1.143 by root, Sun May 18 19:53:07 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)
981 983
982 if (QUERY_FLAG (op, FLAG_GENERATOR)) 984 if (QUERY_FLAG (op, FLAG_GENERATOR))
983 { 985 {
984 total_exp += op->stats.exp; 986 total_exp += op->stats.exp;
985 987
986 if (archetype *at = type_to_archetype (GENERATE_TYPE (op))) 988 if (archetype *at = op->other_arch)
989 {
987 total_exp += at->stats.exp * 8; 990 total_exp += at->stats.exp * 8;
988
989 monster_cnt++; 991 monster_cnt++;
992 }
993
994 for (object *inv = op->inv; inv; inv = inv->below)
995 {
996 total_exp += op->stats.exp * 8;
997 monster_cnt++;
998 }
990 } 999 }
991 } 1000 }
992 1001
993 avgexp = (double) total_exp / monster_cnt; 1002 avgexp = (double) total_exp / monster_cnt;
994 1003
1033 else 1042 else
1034 darkness = new_level; 1043 darkness = new_level;
1035 1044
1036 /* All clients need to get re-updated for the change */ 1045 /* All clients need to get re-updated for the change */
1037 update_all_map_los (this); 1046 update_all_map_los (this);
1047
1038 return 1; 1048 return 1;
1039} 1049}
1040 1050
1041/* 1051/*
1042 * This function updates various attributes about a specific space 1052 * This function updates various attributes about a specific space
1045 * through, etc) 1055 * through, etc)
1046 */ 1056 */
1047void 1057void
1048mapspace::update_ () 1058mapspace::update_ ()
1049{ 1059{
1050 object *tmp, *last = 0; 1060 object *last = 0;
1051 uint8 flags = P_UPTODATE, light = 0, anywhere = 0; 1061 uint8 flags = P_UPTODATE, light = 0, anywhere = 0;
1052 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;
1053 1063
1054 //object *middle = 0; 1064 //object *middle = 0;
1055 //object *top = 0; 1065 //object *top = 0;
1057 // this seems to generate better code than using locals, above 1067 // this seems to generate better code than using locals, above
1058 object *&top = faces_obj[0] = 0; 1068 object *&top = faces_obj[0] = 0;
1059 object *&middle = faces_obj[1] = 0; 1069 object *&middle = faces_obj[1] = 0;
1060 object *&floor = faces_obj[2] = 0; 1070 object *&floor = faces_obj[2] = 0;
1061 1071
1062 for (tmp = bot; tmp; last = tmp, tmp = tmp->above) 1072 for (object *tmp = bot; tmp; last = tmp, tmp = tmp->above)
1063 { 1073 {
1064 /* This could be made additive I guess (two lights better than 1074 /* This could be made additive I guess (two lights better than
1065 * 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
1066 * light bulbs do not illuminate twice as far as once since 1076 * light bulbs do not illuminate twice as far as once since
1067 * it is a dissapation factor that is cubed. 1077 * it is a dissapation factor that is cubed.
1093 else if (QUERY_FLAG (tmp, FLAG_SEE_ANYWHERE)) 1103 else if (QUERY_FLAG (tmp, FLAG_SEE_ANYWHERE))
1094 { 1104 {
1095 middle = tmp; 1105 middle = tmp;
1096 anywhere = 1; 1106 anywhere = 1;
1097 } 1107 }
1108
1098 /* Find the highest visible face around. If equal 1109 /* Find the highest visible face around. If equal
1099 * visibilities, we still want the one nearer to the 1110 * visibilities, we still want the one nearer to the
1100 * top 1111 * top
1101 */ 1112 */
1102 else if (!middle || (::faces [tmp->face].visibility > ::faces [middle->face].visibility && !anywhere)) 1113 else if (!middle || (::faces [tmp->face].visibility > ::faces [middle->face].visibility && !anywhere))
1151 * 1) top face is set, need middle to be set. 1162 * 1) top face is set, need middle to be set.
1152 * 2) middle is set, need to set top. 1163 * 2) middle is set, need to set top.
1153 * 3) neither middle or top is set - need to set both. 1164 * 3) neither middle or top is set - need to set both.
1154 */ 1165 */
1155 1166
1156 for (tmp = last; tmp; tmp = tmp->below) 1167 for (object *tmp = last; tmp; tmp = tmp->below)
1157 { 1168 {
1158 /* Once we get to a floor, stop, since we already have a floor object */ 1169 /* Once we get to a floor, stop, since we already have a floor object */
1159 if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) 1170 if (QUERY_FLAG (tmp, FLAG_IS_FLOOR))
1160 break; 1171 break;
1161 1172
1564} 1575}
1565 1576
1566object * 1577object *
1567maptile::insert (object *op, int x, int y, object *originator, int flags) 1578maptile::insert (object *op, int x, int y, object *originator, int flags)
1568{ 1579{
1569 if (!op->flag [FLAG_REMOVED])
1570 op->remove ();
1571
1572 return insert_ob_in_map_at (op, this, originator, flags, x, y); 1580 return insert_ob_in_map_at (op, this, originator, flags, x, y);
1573} 1581}
1574 1582
1575region * 1583region *
1576maptile::region (int x, int y) const 1584maptile::region (int x, int y) const

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines