… | |
… | |
477 | * before flushing. |
477 | * before flushing. |
478 | */ |
478 | */ |
479 | void |
479 | void |
480 | AskFaceCmd (char *buf, int len, client *ns) |
480 | AskFaceCmd (char *buf, int len, client *ns) |
481 | { |
481 | { |
482 | ns->askface.push_back (atoi (buf)); |
482 | ns->ixface.push_back (atoi (buf)); |
483 | } |
483 | } |
484 | |
484 | |
485 | /** |
485 | /** |
486 | * Tells client the picture it has to use |
486 | * Tells client the picture it has to use |
487 | * to smooth a picture number given as argument. |
487 | * to smooth a picture number given as argument. |
… | |
… | |
747 | |
747 | |
748 | //TODO: maybe golem should become the current_weapon, quite simply? |
748 | //TODO: maybe golem should become the current_weapon, quite simply? |
749 | if (pl->golem) |
749 | if (pl->golem) |
750 | buf << " Golem*: " << pl->golem->name; |
750 | buf << " Golem*: " << pl->golem->name; |
751 | |
751 | |
|
|
752 | buf << '\0'; |
752 | buf.linearise (obuf); |
753 | buf.linearise (obuf); |
753 | obuf [buf.size ()] = 0; |
|
|
754 | } |
754 | } |
755 | |
755 | |
756 | #define AddIfInt64(Old,New,Type) if (Old != New) {\ |
756 | #define AddIfInt64(Old,New,Type) if (Old != New) {\ |
757 | Old = New; \ |
757 | Old = New; \ |
758 | sl << uint8 (Type) << uint64 (New); \ |
758 | sl << uint8 (Type) << uint64 (New); \ |
… | |
… | |
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 |