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.172 by root, Sun Nov 8 20:55:39 2009 UTC vs.
Revision 1.174 by root, Tue Nov 10 05:05:22 2009 UTC

218 218
219 return 0; 219 return 0;
220} 220}
221 221
222/* When the map is loaded, load_object does not actually insert objects 222/* When the map is loaded, load_object does not actually insert objects
223 * into inventory, but just links them. What this does is go through 223 * into inventory, but just links them. What this does is go through
224 * and insert them properly. 224 * and insert them properly.
225 * The object 'container' is the object that contains the inventory. 225 * The object 'container' is the object that contains the inventory.
226 * This is needed so that we can update the containers weight. 226 * This is needed so that we can update the containers weight.
227 */ 227 */
228static void 228static void
448 * map archetype. Mimic that behaviour. 448 * map archetype. Mimic that behaviour.
449 */ 449 */
450 width = 16; 450 width = 16;
451 height = 16; 451 height = 16;
452 timeout = 300; 452 timeout = 300;
453 max_nrof = 1000; // 1000 items of anything
454 max_items = MAX_ITEM_PER_ACTION; 453 max_items = MAX_ITEM_PER_ACTION;
455 max_volume = 2000000; // 2m³ 454 max_volume = 2000000; // 2m³
456} 455}
457 456
458maptile::maptile (int w, int h) 457maptile::maptile (int w, int h)
1034 sint8 light = 0; 1033 sint8 light = 0;
1035 MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0; 1034 MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0;
1036 uint64_t volume = 0; 1035 uint64_t volume = 0;
1037 uint32_t items = 0; 1036 uint32_t items = 0;
1038 object *anywhere = 0; 1037 object *anywhere = 0;
1038 uint8_t middle_visibility = 0;
1039 1039
1040 //object *middle = 0; 1040 //object *middle = 0;
1041 //object *top = 0; 1041 //object *top = 0;
1042 //object *floor = 0; 1042 //object *floor = 0;
1043 // this seems to generate better code than using locals, above 1043 // this seems to generate better code than using locals, above
1060 * 1060 *
1061 * Always put the player down for drawing. 1061 * Always put the player down for drawing.
1062 */ 1062 */
1063 if (expect_true (!tmp->invisible)) 1063 if (expect_true (!tmp->invisible))
1064 { 1064 {
1065 if (tmp->type == PLAYER || tmp->flag [FLAG_MONSTER]) 1065 if (expect_false (tmp->type == PLAYER || tmp->flag [FLAG_MONSTER]))
1066 top = tmp; 1066 top = tmp;
1067 else if (expect_false (tmp->flag [FLAG_IS_FLOOR]))
1068 {
1069 /* If we got a floor, that means middle and top were below it,
1070 * so should not be visible, so we clear them.
1071 */
1072 middle = 0;
1073 top = 0;
1074 floor = tmp;
1075 volume = 0;
1076 items = 0;
1077 }
1067 else 1078 else
1068 { 1079 {
1069 if (expect_false (tmp->flag [FLAG_IS_FLOOR])) 1080 if (expect_true (!tmp->flag [FLAG_NO_PICK]))
1070 { 1081 {
1071 /* If we got a floor, that means middle and top were below it,
1072 * so should not be visible, so we clear them.
1073 */
1074 middle = 0;
1075 top = 0;
1076 floor = tmp;
1077 volume = 0;
1078 items = 0; 1082 ++items;
1083 volume += tmp->volume ();
1079 } 1084 }
1085
1086 /* Flag anywhere have high priority */
1087 if (expect_false (tmp->flag [FLAG_SEE_ANYWHERE]))
1088 anywhere = tmp;
1089
1090 /* Find the highest visible face around. If equal
1091 * visibilities, we still want the one nearer to the
1092 * top
1080 else 1093 */
1094 if (expect_false (::faces [tmp->face].visibility >= middle_visibility))
1081 { 1095 {
1082 if (expect_true (!tmp->flag [FLAG_NO_PICK])) 1096 middle_visibility = ::faces [tmp->face].visibility;
1083 {
1084 ++items;
1085 volume += tmp->volume ();
1086 }
1087
1088 /* Flag anywhere have high priority */
1089 if (expect_false (tmp->flag [FLAG_SEE_ANYWHERE]))
1090 anywhere = tmp;
1091 /* Find the highest visible face around. If equal
1092 * visibilities, we still want the one nearer to the
1093 * top
1094 */
1095 else if (!middle || (::faces [tmp->face].visibility > ::faces [middle->face].visibility))
1096 middle = tmp; 1097 middle = tmp;
1097 } 1098 }
1098 } 1099 }
1099 } 1100 }
1100 1101
1101 move_slow |= tmp->move_slow; 1102 move_slow |= tmp->move_slow;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines