Fixed some LGTM warnings (#6767)
Co-authored-by: aleos <aleos89@users.noreply.github.com>
This commit is contained in:
@@ -215,14 +215,12 @@ void chmapif_send_maps(int fd, int map_id, int count, unsigned char *mapbuf) {
|
||||
// Transmitting the maps of the other map-servers to the new map-server
|
||||
for (x = 0; x < ARRAYLENGTH(map_server); x++) {
|
||||
if (session_isValid(map_server[x].fd) && x != map_id) {
|
||||
uint16 i, j;
|
||||
|
||||
WFIFOHEAD(fd,10 +4*map_server[x].map.size());
|
||||
WFIFOW(fd,0) = 0x2b04;
|
||||
WFIFOL(fd,4) = htonl(map_server[x].ip);
|
||||
WFIFOW(fd,8) = htons(map_server[x].port);
|
||||
j = 0;
|
||||
for(i = 0; i < map_server[x].map.size(); i++)
|
||||
uint16 j = 0;
|
||||
for(size_t i = 0; i < map_server[x].map.size(); i++)
|
||||
if (map_server[x].map[i])
|
||||
WFIFOW(fd,10+(j++)*4) = map_server[x].map[i];
|
||||
if (j > 0) {
|
||||
@@ -1500,7 +1498,7 @@ void chmapif_server_reset(int id){
|
||||
WBUFW(buf,0) = 0x2b20;
|
||||
WBUFL(buf,4) = htonl(map_server[id].ip);
|
||||
WBUFW(buf,8) = htons(map_server[id].port);
|
||||
for(uint16 i = 0; i < map_server[id].map.size(); i++)
|
||||
for(size_t i = 0; i < map_server[id].map.size(); i++)
|
||||
if (map_server[id].map[i])
|
||||
WBUFW(buf,10+(j++)*4) = map_server[id].map[i];
|
||||
if (j > 0) {
|
||||
|
||||
Reference in New Issue
Block a user