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.147 by root, Mon Sep 29 10:20:48 2008 UTC vs.
Revision 1.150 by root, Thu Dec 4 03:48:19 2008 UTC

351 ms.flags_ = 0; 351 ms.flags_ = 0;
352 } 352 }
353 else 353 else
354 { 354 {
355 f.parse_warn (format ("object %s out of range", op->debug_desc ())); 355 f.parse_warn (format ("object %s out of range", op->debug_desc ()));
356 op->destroy_inv (false); // be explicit about dropping
357 op->destroy (true); 356 op->destroy ();
358 } 357 }
359 } 358 }
360 359
361 continue; 360 continue;
362 361
713 712
714 if (QUERY_FLAG (op, FLAG_IS_FLOOR) && QUERY_FLAG (op, FLAG_UNIQUE)) 713 if (QUERY_FLAG (op, FLAG_IS_FLOOR) && QUERY_FLAG (op, FLAG_UNIQUE))
715 unique = 1; 714 unique = 1;
716 715
717 if (op->head_ () == op && (QUERY_FLAG (op, FLAG_UNIQUE) || unique)) 716 if (op->head_ () == op && (QUERY_FLAG (op, FLAG_UNIQUE) || unique))
718 {
719 op->destroy_inv (false);
720 op->destroy (true); 717 op->destroy ();
721 }
722 718
723 op = above; 719 op = above;
724 } 720 }
725 } 721 }
726} 722}
814 810
815 op->flag [FLAG_REMOVED] = true; 811 op->flag [FLAG_REMOVED] = true;
816 812
817 object *head = op->head_ (); 813 object *head = op->head_ ();
818 if (op == head) 814 if (op == head)
819 {
820 op->destroy_inv (false);
821 op->destroy (true); 815 op->destroy ();
822 }
823 else if (head->map != op->map) 816 else if (head->map != op->map)
824 { 817 {
825 LOG (llevDebug, "bad luck for object crossing map borders: %s", head->debug_desc ()); 818 LOG (llevDebug, "bad luck for object crossing map borders: %s", head->debug_desc ());
826 head->destroy (true); 819 head->destroy ();
827 } 820 }
828 } 821 }
829 822
830 sfree0 (spaces, size ()); 823 sfree0 (spaces, size ());
831 } 824 }
937 destroy = 1; 930 destroy = 1;
938 } 931 }
939 932
940 /* adjust overall chance below */ 933 /* adjust overall chance below */
941 if (destroy && rndm (0, 1)) 934 if (destroy && rndm (0, 1))
942 op->destroy (true); 935 op->destroy ();
943 } 936 }
944} 937}
945 938
946/* 939/*
947 * Updates every button on the map (by calling update_button() for them). 940 * Updates every button on the map (by calling update_button() for them).
1068 */ 1061 */
1069void 1062void
1070mapspace::update_ () 1063mapspace::update_ ()
1071{ 1064{
1072 object *last = 0; 1065 object *last = 0;
1073 uint8 flags = P_UPTODATE, light = 0, anywhere = 0; 1066 uint8 flags = P_UPTODATE, anywhere = 0;
1067 sint8 light = 0;
1074 MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0; 1068 MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0;
1075 1069
1076 //object *middle = 0; 1070 //object *middle = 0;
1077 //object *top = 0; 1071 //object *top = 0;
1078 //object *floor = 0; 1072 //object *floor = 0;
1081 object *&middle = faces_obj[1] = 0; 1075 object *&middle = faces_obj[1] = 0;
1082 object *&floor = faces_obj[2] = 0; 1076 object *&floor = faces_obj[2] = 0;
1083 1077
1084 for (object *tmp = bot; tmp; last = tmp, tmp = tmp->above) 1078 for (object *tmp = bot; tmp; last = tmp, tmp = tmp->above)
1085 { 1079 {
1086 /* This could be made additive I guess (two lights better than 1080 // Lights are additive, up to MAX_LIGHT_RADIUS, see los.C)
1087 * one). But if so, it shouldn't be a simple additive - 2
1088 * light bulbs do not illuminate twice as far as once since
1089 * it is a dissapation factor that is cubed.
1090 */
1091 light = max (light, tmp->glow_radius); 1081 light += tmp->glow_radius;
1092 1082
1093 /* This call is needed in order to update objects the player 1083 /* This call is needed in order to update objects the player
1094 * is standing in that have animations (ie, grass, fire, etc). 1084 * is standing in that have animations (ie, grass, fire, etc).
1095 * However, it also causes the look window to be re-drawn 1085 * However, it also causes the look window to be re-drawn
1096 * 3 times each time the player moves, because many of the 1086 * 3 times each time the player moves, because many of the
1144 if (tmp->type == SAFE_GROUND) flags |= P_SAFE; 1134 if (tmp->type == SAFE_GROUND) flags |= P_SAFE;
1145 if (QUERY_FLAG (tmp, FLAG_ALIVE)) flags |= P_IS_ALIVE; 1135 if (QUERY_FLAG (tmp, FLAG_ALIVE)) flags |= P_IS_ALIVE;
1146 if (QUERY_FLAG (tmp, FLAG_DAMNED)) flags |= P_NO_CLERIC; 1136 if (QUERY_FLAG (tmp, FLAG_DAMNED)) flags |= P_NO_CLERIC;
1147 } 1137 }
1148 1138
1149 this->light = light; 1139 this->light = min (light, MAX_LIGHT_RADIUS);
1150 this->flags_ = flags; 1140 this->flags_ = flags;
1151 this->move_block = move_block & ~move_allow; 1141 this->move_block = move_block & ~move_allow;
1152 this->move_on = move_on; 1142 this->move_on = move_on;
1153 this->move_off = move_off; 1143 this->move_off = move_off;
1154 this->move_slow = move_slow; 1144 this->move_slow = move_slow;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines