summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-05-21 15:59:59 +0200
committerHaru <haru@dotalux.com>2014-05-21 15:59:59 +0200
commitcd1be22f3a10c2da4817ebf10cd1425f443c6a10 (patch)
tree071e2e1b14ad674e06e8f0191af055b3aa4c999b /src/map/skill.c
parentbd86d05a59e9680ff8c645854a546617a9caaf2e (diff)
downloadhercules-cd1be22f3a10c2da4817ebf10cd1425f443c6a10.tar.gz
hercules-cd1be22f3a10c2da4817ebf10cd1425f443c6a10.tar.bz2
hercules-cd1be22f3a10c2da4817ebf10cd1425f443c6a10.tar.xz
hercules-cd1be22f3a10c2da4817ebf10cd1425f443c6a10.zip
Corrected a nullpo report in 4c8d773d72ae134f7cc4d43861104ecd9f4ae134
Special thanks to ossi0110 Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 90c0bbec6..383720361 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -15289,15 +15289,14 @@ bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce
/**
* Verifies if an user can use SC_CLOAKING
**/
-bool skill_can_cloak(struct map_session_data *sd, struct block_list *bl) {
+bool skill_can_cloak(struct map_session_data *sd) {
nullpo_retr(false, sd);
- nullpo_retr(false, bl);
//Avoid cloaking with no wall and low skill level. [Skotlex]
//Due to the cloaking card, we have to check the wall versus to known
//skill level rather than the used one. [Skotlex]
//if (sd && val1 < 3 && skill_check_cloaking(bl,NULL))
- if( sd && pc->checkskill(sd, AS_CLOAKING) < 3 && !skill->check_cloaking(bl,NULL) )
+ if (pc->checkskill(sd, AS_CLOAKING) < 3 && !skill->check_cloaking(&sd->bl,NULL))
return false;
return true;
@@ -15308,12 +15307,9 @@ bool skill_can_cloak(struct map_session_data *sd, struct block_list *bl) {
* Is called via map->foreachinrange when any kind of wall disapears
**/
int skill_check_cloaking_end(struct block_list *bl, va_list ap) {
- TBL_PC *sd = (TBL_PC*)bl;
-
- if( bl == NULL || sd == NULL )
- return 0;
+ TBL_PC *sd = BL_CAST(BL_PC, bl);
- if( sd->sc.data[SC_CLOAKING] && !skill_can_cloak(sd, bl) )
+ if (sd && sd->sc.data[SC_CLOAKING] && !skill->can_cloak(sd))
status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
return 0;