diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-04-18 22:13:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-04-18 22:13:55 +0300 |
commit | 57dcd1c108005f827c8c99a8943d602799213d1e (patch) | |
tree | 9dc1d2307a05b29cd4375bea592a3df57bdb206e /src | |
parent | 49a6be313f501dc0695193333e3a3e94656dc28a (diff) | |
download | hercules-57dcd1c108005f827c8c99a8943d602799213d1e.tar.gz hercules-57dcd1c108005f827c8c99a8943d602799213d1e.tar.bz2 hercules-57dcd1c108005f827c8c99a8943d602799213d1e.tar.xz hercules-57dcd1c108005f827c8c99a8943d602799213d1e.zip |
Move death penalty job check from pc_dead into separate function.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/pc.c | 11 | ||||
-rw-r--r-- | src/map/pc.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index f4f2b5044..08fbae7ea 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -8088,8 +8088,8 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { } // changed penalty options, added death by player if pk_mode [Valaris] - if( battle_config.death_penalty_type - && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE // only novices will receive no penalty + if (battle_config.death_penalty_type + && pc->isDeathPenaltyJob(sd->job) && !map->list[sd->bl.m].flag.noexppenalty && !map_flag_gvg2(sd->bl.m) && !sd->sc.data[SC_BABY] && !sd->sc.data[SC_CASH_DEATHPENALTY] ) { @@ -8237,6 +8237,11 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { return 1; } +bool pc_isDeathPenaltyJob(uint16 job) +{ + return (job & MAPID_UPPERMASK) != MAPID_NOVICE; // only novices will receive no penalty +} + void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) { nullpo_retv(sd); if(hp) clif->updatestatus(sd,SP_HP); @@ -12517,4 +12522,6 @@ void pc_defaults(void) { pc->have_magnifier = pc_have_magnifier; pc->check_basicskill = pc_check_basicskill; + + pc->isDeathPenaltyJob = pc_isDeathPenaltyJob; } diff --git a/src/map/pc.h b/src/map/pc.h index 77bc795d6..62a829734 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -1143,6 +1143,7 @@ END_ZEROED_BLOCK; /* End */ bool (*process_chat_message) (struct map_session_data *sd, const char *message); void (*check_supernovice_call) (struct map_session_data *sd, const char *message); bool (*check_basicskill) (struct map_session_data *sd, int level); + bool (*isDeathPenaltyJob) (uint16 job); }; #ifdef HERCULES_CORE |