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.141 by root, Wed May 7 11:02:50 2008 UTC vs.
Revision 1.142 by root, Sun May 18 17:52:53 2008 UTC

1042 else 1042 else
1043 darkness = new_level; 1043 darkness = new_level;
1044 1044
1045 /* All clients need to get re-updated for the change */ 1045 /* All clients need to get re-updated for the change */
1046 update_all_map_los (this); 1046 update_all_map_los (this);
1047
1047 return 1; 1048 return 1;
1048} 1049}
1049 1050
1050/* 1051/*
1051 * This function updates various attributes about a specific space 1052 * This function updates various attributes about a specific space
1054 * through, etc) 1055 * through, etc)
1055 */ 1056 */
1056void 1057void
1057mapspace::update_ () 1058mapspace::update_ ()
1058{ 1059{
1059 object *tmp, *last = 0; 1060 object *last = 0;
1060 uint8 flags = P_UPTODATE, light = 0, anywhere = 0; 1061 uint8 flags = P_UPTODATE, light = 0, anywhere = 0;
1061 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;
1062 1063
1063 //object *middle = 0; 1064 //object *middle = 0;
1064 //object *top = 0; 1065 //object *top = 0;
1066 // this seems to generate better code than using locals, above 1067 // this seems to generate better code than using locals, above
1067 object *&top = faces_obj[0] = 0; 1068 object *&top = faces_obj[0] = 0;
1068 object *&middle = faces_obj[1] = 0; 1069 object *&middle = faces_obj[1] = 0;
1069 object *&floor = faces_obj[2] = 0; 1070 object *&floor = faces_obj[2] = 0;
1070 1071
1071 for (tmp = bot; tmp; last = tmp, tmp = tmp->above) 1072 for (object *tmp = bot; tmp; last = tmp, tmp = tmp->above)
1072 { 1073 {
1073 /* This could be made additive I guess (two lights better than 1074 /* This could be made additive I guess (two lights better than
1074 * 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
1075 * light bulbs do not illuminate twice as far as once since 1076 * light bulbs do not illuminate twice as far as once since
1076 * it is a dissapation factor that is cubed. 1077 * it is a dissapation factor that is cubed.
1160 * 1) top face is set, need middle to be set. 1161 * 1) top face is set, need middle to be set.
1161 * 2) middle is set, need to set top. 1162 * 2) middle is set, need to set top.
1162 * 3) neither middle or top is set - need to set both. 1163 * 3) neither middle or top is set - need to set both.
1163 */ 1164 */
1164 1165
1165 for (tmp = last; tmp; tmp = tmp->below) 1166 for (object *tmp = last; tmp; tmp = tmp->below)
1166 { 1167 {
1167 /* 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 */
1168 if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) 1169 if (QUERY_FLAG (tmp, FLAG_IS_FLOOR))
1169 break; 1170 break;
1170 1171
1573} 1574}
1574 1575
1575object * 1576object *
1576maptile::insert (object *op, int x, int y, object *originator, int flags) 1577maptile::insert (object *op, int x, int y, object *originator, int flags)
1577{ 1578{
1578 if (!op->flag [FLAG_REMOVED])
1579 op->remove ();
1580
1581 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);
1582} 1580}
1583 1581
1584region * 1582region *
1585maptile::region (int x, int y) const 1583maptile::region (int x, int y) const

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines