… | |
… | |
1670 | for (y = pl->y - socket.mapy / 2; y < max_y; y++, ay++) |
1670 | for (y = pl->y - socket.mapy / 2; y < max_y; y++, ay++) |
1671 | { |
1671 | { |
1672 | ax = 0; |
1672 | ax = 0; |
1673 | for (x = pl->x - socket.mapx / 2; x < max_x; x++, ax++) |
1673 | for (x = pl->x - socket.mapx / 2; x < max_x; x++, ax++) |
1674 | { |
1674 | { |
1675 | |
|
|
1676 | emask = mask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4; |
1675 | emask = mask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4; |
1677 | |
1676 | |
1678 | /* If this space is out of the normal viewable area, we only check |
1677 | /* If this space is out of the normal viewable area, we only check |
1679 | * the heads value ax or ay will only be greater than what |
1678 | * the heads value ax or ay will only be greater than what |
1680 | * the client wants if using the map1a command - this is because |
1679 | * the client wants if using the map1a command - this is because |
… | |
… | |
2011 | return; |
2010 | return; |
2012 | |
2011 | |
2013 | memset (&newmap, 0, sizeof (struct Map)); |
2012 | memset (&newmap, 0, sizeof (struct Map)); |
2014 | |
2013 | |
2015 | for (j = (pl->y - pl->contr->socket->mapy / 2); j < (pl->y + (pl->contr->socket->mapy + 1) / 2); j++) |
2014 | for (j = (pl->y - pl->contr->socket->mapy / 2); j < (pl->y + (pl->contr->socket->mapy + 1) / 2); j++) |
2016 | { |
|
|
2017 | for (i = (pl->x - pl->contr->socket->mapx / 2); i < (pl->x + (pl->contr->socket->mapx + 1) / 2); i++) |
2015 | for (i = (pl->x - pl->contr->socket->mapx / 2); i < (pl->x + (pl->contr->socket->mapx + 1) / 2); i++) |
2018 | { |
2016 | { |
2019 | ax = i; |
2017 | ax = i; |
2020 | ay = j; |
2018 | ay = j; |
2021 | m = pm; |
2019 | m = pm; |
2022 | mflags = get_map_flags (m, &m, ax, ay, &ax, &ay); |
2020 | mflags = get_map_flags (m, &m, ax, ay, &ax, &ay); |
2023 | |
2021 | |
2024 | if (mflags & P_OUT_OF_MAP) |
2022 | if (mflags & P_OUT_OF_MAP) |
2025 | continue; |
2023 | continue; |
2026 | |
2024 | |
2027 | if (mflags & P_NEED_UPDATE) |
|
|
2028 | update_position (m, ax, ay); |
|
|
2029 | |
|
|
2030 | /* If a map is visible to the player, we don't want to swap it out |
2025 | /* If a map is visible to the player, we don't want to swap it out |
2031 | * just to reload it. This should really call something like |
2026 | * just to reload it. This should really call something like |
2032 | * swap_map, but this is much more efficient and 'good enough' |
2027 | * swap_map, but this is much more efficient and 'good enough' |
2033 | */ |
2028 | */ |
2034 | if (mflags & P_NEW_MAP) |
2029 | if (mflags & P_NEW_MAP) |
2035 | m->timeout = 50; |
2030 | m->timeout = 50; |
2036 | } |
2031 | } |
2037 | } |
2032 | |
2038 | /* do LOS after calls to update_position */ |
2033 | /* do LOS after calls to update_position */ |
2039 | if (pl->contr->do_los) |
2034 | if (pl->contr->do_los) |
2040 | { |
2035 | { |
2041 | update_los (pl); |
2036 | update_los (pl); |
2042 | pl->contr->do_los = 0; |
2037 | pl->contr->do_los = 0; |