From 58e3177021890543faf6363fcb3326617100571d Mon Sep 17 00:00:00 2001 From: Haru Date: Fri, 18 Sep 2015 17:48:20 +0200 Subject: Clarified the intent of several assignments inside conditional expressions Signed-off-by: Haru --- src/map/clif.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 991c9a0e7..167a63d75 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -520,7 +520,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target break; case SELF: - if (sd && (fd=sd->fd) ) { + if (sd && (fd=sd->fd) != 0) { WFIFOHEAD(fd,len); memcpy(WFIFOP(fd,0), buf, len); WFIFOSET(fd,len); @@ -617,7 +617,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target for( i = 0; i < queue->size; i++ ) { struct map_session_data *qsd = NULL; - if( queue->item[i] > 0 && ( qsd = map->id2sd(queue->item[i]) ) ) { + if (queue->item[i] > 0 && (qsd = map->id2sd(queue->item[i])) != NULL) { WFIFOHEAD(qsd->fd,len); memcpy(WFIFOP(qsd->fd,0), buf, len); WFIFOSET(qsd->fd,len); @@ -2065,7 +2065,7 @@ void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes) { nullpo_retv(mes); fd = sd->fd; slen = strlen(mes) + 9; - if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) && (bl->m!=sd->bl.m || + if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) != NULL && (bl->m!=sd->bl.m || bl->xbl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 || bl->ybl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1)))) clif->sendfakenpc(sd, npcid); @@ -2096,7 +2096,7 @@ void clif_scriptinput(struct map_session_data *sd, int npcid) { nullpo_retv(sd); - if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) && (bl->m!=sd->bl.m || + if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) != NULL && (bl->m!=sd->bl.m || bl->xbl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 || bl->ybl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1)))) clif->sendfakenpc(sd, npcid); @@ -2126,7 +2126,7 @@ void clif_scriptinputstr(struct map_session_data *sd, int npcid) { nullpo_retv(sd); - if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) && (bl->m!=sd->bl.m || + if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) != NULL && (bl->m!=sd->bl.m || bl->xbl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 || bl->ybl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1)))) clif->sendfakenpc(sd, npcid); @@ -18430,7 +18430,7 @@ void clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd) { for(i = 0, c = 0; i < shop_size; i++) { struct item_data *id = NULL; - if( shop[i].nameid && (id = itemdb->exists(shop[i].nameid)) ) { + if (shop[i].nameid && (id = itemdb->exists(shop[i].nameid)) != NULL) { npcmarket_open.list[c].nameid = shop[i].nameid; npcmarket_open.list[c].price = shop[i].value; npcmarket_open.list[c].qty = shop[i].qty; -- cgit v1.2.3-70-g09d2