summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-06-01 04:01:16 +0200
committerGitHub <noreply@github.com>2020-06-01 04:01:16 +0200
commitb9f7d1439c84b64facaf7d2875adc29110c65cf4 (patch)
tree808162f3083ac05b3221c7ffcdb4e52ffd4fb90a /src/map/status.c
parent6188b2eb25c9fdcd33cfbef50e3dd41774f37994 (diff)
parent410e04c2562f7d7dd9a2f242d6ef821dbe0b2fc5 (diff)
downloadhercules-b9f7d1439c84b64facaf7d2875adc29110c65cf4.tar.gz
hercules-b9f7d1439c84b64facaf7d2875adc29110c65cf4.tar.bz2
hercules-b9f7d1439c84b64facaf7d2875adc29110c65cf4.tar.xz
hercules-b9f7d1439c84b64facaf7d2875adc29110c65cf4.zip
Merge pull request #2713 from 4144/updatepackets
Update packets up to 2020-05-20
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 637342632..589acff5c 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -6407,13 +6407,24 @@ static int status_get_class(const struct block_list *bl)
{
nullpo_ret(bl);
switch (bl->type) {
- case BL_PC: return BL_UCCAST(BL_PC, bl)->status.class;
- case BL_MOB: return BL_UCCAST(BL_MOB, bl)->vd->class; //Class used on all code should be the view class of the mob.
- case BL_PET: return BL_UCCAST(BL_PET, bl)->pet.class_;
- case BL_HOM: return BL_UCCAST(BL_HOM, bl)->homunculus.class_;
- case BL_MER: return BL_UCCAST(BL_MER, bl)->mercenary.class_;
- case BL_NPC: return BL_UCCAST(BL_NPC, bl)->class_;
- case BL_ELEM: return BL_UCCAST(BL_ELEM, bl)->elemental.class_;
+ case BL_PC:
+ return BL_UCCAST(BL_PC, bl)->status.class;
+ case BL_MOB:
+ {
+ const struct view_data *const vd = BL_UCCAST(BL_MOB, bl)->vd;
+ nullpo_ret(vd);
+ return vd->class; //Class used on all code should be the view class of the mob.
+ }
+ case BL_PET:
+ return BL_UCCAST(BL_PET, bl)->pet.class_;
+ case BL_HOM:
+ return BL_UCCAST(BL_HOM, bl)->homunculus.class_;
+ case BL_MER:
+ return BL_UCCAST(BL_MER, bl)->mercenary.class_;
+ case BL_NPC:
+ return BL_UCCAST(BL_NPC, bl)->class_;
+ case BL_ELEM:
+ return BL_UCCAST(BL_ELEM, bl)->elemental.class_;
}
return 0;
}