summaryrefslogtreecommitdiff
path: root/src/map/pc.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/pc.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/pc.c')
-rw-r--r--src/map/pc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 36bcbae88..14d234d82 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1306,7 +1306,7 @@ int pc_reg_received(struct map_session_data *sd)
if ((i = pc->checkskill(sd,RG_PLAGIARISM)) > 0) {
sd->cloneskill_id = pc_readglobalreg(sd,script->add_str("CLONE_SKILL"));
- if (sd->cloneskill_id > 0 && (idx = skill->get_index(sd->cloneskill_id))) {
+ if (sd->cloneskill_id > 0 && (idx = skill->get_index(sd->cloneskill_id)) > 0) {
sd->status.skill[idx].id = sd->cloneskill_id;
sd->status.skill[idx].lv = pc_readglobalreg(sd,script->add_str("CLONE_SKILL_LV"));
if (sd->status.skill[idx].lv > i)
@@ -1316,7 +1316,7 @@ int pc_reg_received(struct map_session_data *sd)
}
if ((i = pc->checkskill(sd,SC_REPRODUCE)) > 0) {
sd->reproduceskill_id = pc_readglobalreg(sd,script->add_str("REPRODUCE_SKILL"));
- if( sd->reproduceskill_id > 0 && (idx = skill->get_index(sd->reproduceskill_id))) {
+ if( sd->reproduceskill_id > 0 && (idx = skill->get_index(sd->reproduceskill_id)) > 0) {
sd->status.skill[idx].id = sd->reproduceskill_id;
sd->status.skill[idx].lv = pc_readglobalreg(sd,script->add_str("REPRODUCE_SKILL_LV"));
if( i < sd->status.skill[idx].lv)
@@ -5293,7 +5293,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
// Try dropping one item, in the order from first to last possible slot.
// Droprate is affected by the skill success rate.
for( i = 0; i < MAX_STEAL_DROP; i++ )
- if( md->db->dropitem[i].nameid > 0 && (data = itemdb->exists(md->db->dropitem[i].nameid)) && rnd() % 10000 < md->db->dropitem[i].p * rate/100. )
+ if (md->db->dropitem[i].nameid > 0 && (data = itemdb->exists(md->db->dropitem[i].nameid)) != NULL && rnd() % 10000 < md->db->dropitem[i].p * rate/100.)
break;
if( i == MAX_STEAL_DROP )
return 0;
@@ -5403,7 +5403,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
stop = true;
}
}
- if ( !stop && sd->status.party_id && (p = party->search(sd->status.party_id)) && p->instances ) {
+ if ( !stop && 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 && !map->list[instance->list[p->instance[i]].map[j]].custom_name);
@@ -10675,7 +10675,7 @@ void pc_read_skill_tree(void) {
for (h = offset; h < rlen && h < MAX_PC_SKILL_REQUIRE; h++) {
config_setting_t *rsk = libconfig->setting_get_elem(sk,h);
int rskid;
- if (rsk && ( rskid = skill->name2id(config_setting_name(rsk)))) {
+ if (rsk && (rskid = skill->name2id(config_setting_name(rsk))) != 0) {
pc->skill_tree[idx][skidx].need[h].id = rskid;
pc->skill_tree[idx][skidx].need[h].idx = skill->get_index(rskid);
pc->skill_tree[idx][skidx].need[h].lv = (unsigned char)libconfig->setting_get_int(rsk);