summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-09-18 17:48:20 +0200
committerHaru <haru@dotalux.com>2015-09-18 17:48:20 +0200
commit58e3177021890543faf6363fcb3326617100571d (patch)
tree15b14edc6937bcb50d5ff98893cc48de02aca99b /src/map/unit.c
parent442a306a60d4529f5cae70c0a659b4bc31d2f07b (diff)
downloadhercules-58e3177021890543faf6363fcb3326617100571d.tar.gz
hercules-58e3177021890543faf6363fcb3326617100571d.tar.bz2
hercules-58e3177021890543faf6363fcb3326617100571d.tar.xz
hercules-58e3177021890543faf6363fcb3326617100571d.zip
Clarified the intent of several assignments inside conditional expressions
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 02d1f4c1a..178fc3010 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1765,10 +1765,10 @@ int unit_set_target(struct unit_data* ud, int target_id)
if (ud->target != target_id) {
struct unit_data * ux;
struct block_list* target;
- if( ud->target && (target = map->id2bl(ud->target)) && (ux = unit->bl2ud(target)) && ux->target_count > 0 )
- ux->target_count --;
- if( target_id && (target = map->id2bl(target_id)) && (ux = unit->bl2ud(target)) )
- ux->target_count ++;
+ if (ud->target && (target = map->id2bl(ud->target)) != NULL && (ux = unit->bl2ud(target)) != NULL && ux->target_count > 0)
+ --ux->target_count;
+ if (target_id && (target = map->id2bl(target_id)) != NULL && (ux = unit->bl2ud(target)) != NULL)
+ ++ux->target_count;
}
ud->target = target_id;
@@ -2268,7 +2268,7 @@ void unit_dataset(struct block_list *bl) {
int unit_counttargeted(struct block_list* bl)
{
struct unit_data* ud;
- if( bl && (ud = unit->bl2ud(bl)) )
+ if (bl && (ud = unit->bl2ud(bl)) != NULL)
return ud->target_count;
return 0;
}