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

Comparing deliantra/server/socket/request.C (file contents):
Revision 1.107 by root, Sat Jun 9 20:07:50 2007 UTC vs.
Revision 1.108 by root, Sat Jun 9 20:51:45 2007 UTC

1030 */ 1030 */
1031 if (!plmap || plmap->in_memory != MAP_IN_MEMORY) 1031 if (!plmap || plmap->in_memory != MAP_IN_MEMORY)
1032 return; 1032 return;
1033 1033
1034 int x, y, ax, ay, startlen, max_x, max_y, oldlen; 1034 int x, y, ax, ay, startlen, max_x, max_y, oldlen;
1035 sint16 nx, ny;
1036 int estartlen, eoldlen; 1035 int estartlen, eoldlen;
1037 uint8 eentrysize; 1036 uint8 eentrysize;
1038 uint16 ewhatstart, ewhatflag; 1037 uint16 ewhatstart, ewhatflag;
1039 uint8 extendedinfos; 1038 uint8 extendedinfos;
1040 maptile *m;
1041 1039
1042 check_map_change (pl); 1040 check_map_change (pl);
1043 prefetch_surrounding_maps (pl->ob); 1041 prefetch_surrounding_maps (pl->ob);
1044 1042
1045 /* do LOS after calls to update_position */ 1043 /* do LOS after calls to update_position */
1111 max_x = ob->x + (socket.mapx + 1) / 2; 1109 max_x = ob->x + (socket.mapx + 1) / 2;
1112 max_y = ob->y + (socket.mapy + 1) / 2; 1110 max_y = ob->y + (socket.mapy + 1) / 2;
1113 1111
1114 for (y = ob->y - socket.mapy / 2; y < max_y; y++, ay++) 1112 for (y = ob->y - socket.mapy / 2; y < max_y; y++, ay++)
1115 { 1113 {
1114 sint16 nx, ny;
1115 maptile *m = 0;
1116
1116 ax = 0; 1117 ax = 0;
1117 for (x = ob->x - socket.mapx / 2; x < max_x; x++, ax++) 1118 for (x = ob->x - socket.mapx / 2; x < max_x; x++, ax++)
1118 { 1119 {
1120 // check to see if we can simply go one right quickly
1121 ++nx;
1122 if (m && nx >= m->width)
1123 m = 0;
1124
1125 if (!m)
1126 {
1127 nx = x; ny = y; m = plmap;
1128
1129 if (!xy_normalise (m, nx, ny))
1130 m = 0;
1131 }
1132
1119 int emask, mask; 1133 int emask, mask;
1120 emask = mask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4; 1134 emask = mask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4;
1121 1135
1122 MapCell &lastcell = socket.lastmap.cells[ax][ay]; 1136 MapCell &lastcell = socket.lastmap.cells[ax][ay];
1123 1137
1124 /* If the coordinates are not valid, or it is too dark to see, 1138 /* If the coordinates are not valid, or it is too dark to see,
1125 * we tell the client as such 1139 * we tell the client as such
1126 */ 1140 */
1127 nx = x;
1128 ny = y;
1129 m = get_map_from_coord (plmap, &nx, &ny);
1130
1131 if (!m) 1141 if (!m)
1132 { 1142 {
1133 /* space is out of map. Update space and clear values 1143 /* space is out of map. Update space and clear values
1134 * if this hasn't already been done. If the space is out 1144 * if this hasn't already been done. If the space is out
1135 * of the map, it shouldn't have a head 1145 * of the map, it shouldn't have a head

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines