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/script.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index 35142a4f5..45274e3dd 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -1234,7 +1234,7 @@ const char* parse_simpleexpr(const char *p) script_string_buf_addb(sbuf, 0); - if( !(script->syntax.translation_db && (st = strdb_get(script->syntax.translation_db, sbuf->ptr))) ) { + if (!(script->syntax.translation_db && (st = strdb_get(script->syntax.translation_db, sbuf->ptr)) != NULL)) { script->addc(C_STR); if( script->pos+sbuf->pos >= script->size ) { @@ -6291,7 +6291,7 @@ BUILDIN(__setr) { if (!not_array_variable(*namevalue)) { // array variable being copied into another array variable - if (sd == NULL && not_server_variable(*namevalue) && !(sd = script->rid2sd(st))) { + if (sd == NULL && not_server_variable(*namevalue) && (sd = script->rid2sd(st)) == NULL) { // player must be attached in order to copy a player variable ShowError("script:set: no player attached for player variable '%s'\n", namevalue); return true; @@ -11136,7 +11136,7 @@ BUILDIN(roclass) sex = script_getnum(st,3); else { TBL_PC *sd; - if (st->rid && (sd=script->rid2sd(st))) + if (st->rid && (sd=script->rid2sd(st)) != NULL) sex = sd->status.sex; else sex = 1; //Just use male when not found. @@ -17779,7 +17779,7 @@ BUILDIN(has_instance) { if( i != sd->instances ) instance_id = sd->instance[i]; } - if( instance_id == -1 && sd->status.party_id && (p = party->search(sd->status.party_id)) && p->instances ) { + if (instance_id == -1 && sd->status.party_id && (p = party->search(sd->status.party_id)) != NULL && p->instances) { for( i = 0; i < p->instances; i++ ) { if( p->instance[i] >= 0 ) { ARR_FIND(0, instance->list[p->instance[i]].num_map, j, map->list[instance->list[p->instance[i]].map[j]].instance_src_map == m); @@ -18886,7 +18886,7 @@ bool script_hqueue_add(int idx, int var) script->hq[idx].item[i] = var; script->hq[idx].items++; - if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var))) { + if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) != NULL) { for (i = 0; i < sd->queues_count; i++) { if (sd->queues[i] == -1) { break; @@ -18932,7 +18932,7 @@ bool script_hqueue_remove(int idx, int var) { script->hq[idx].item[i] = -1; script->hq[idx].items--; - if( var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) ) { + if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) != NULL) { for(i = 0; i < sd->queues_count; i++) { if( sd->queues[i] == idx ) { break; @@ -19010,7 +19010,7 @@ bool script_hqueue_del(int idx) int i; for (i = 0; i < script->hq[idx].size; i++) { struct map_session_data *sd; - if( script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) ) { + if (script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) != NULL) { int j; for(j = 0; j < sd->queues_count; j++) { if( sd->queues[j] == script->hq[idx].item[i] ) { @@ -19049,7 +19049,7 @@ void script_hqueue_clear(int idx) { for(i = 0; i < script->hq[idx].size; i++) { if( script->hq[idx].item[i] > 0 ) { - if( script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) ) { + if (script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) != NULL) { for(j = 0; j < sd->queues_count; j++) { if( sd->queues[j] == idx ) { break; -- cgit v1.2.3-60-g2f50