diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-04-18 22:13:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-04-23 07:33:45 +0300 |
commit | 1935ad18f51f0b72d95411d1ccd24a568e91cc20 (patch) | |
tree | b46a2ecbd43496080f5dc3926b3c064ab1b5d789 /src | |
parent | 31400d054ec5744e43deb4a6928f496d92f01c34 (diff) | |
download | hercules-1935ad18f51f0b72d95411d1ccd24a568e91cc20.tar.gz hercules-1935ad18f51f0b72d95411d1ccd24a568e91cc20.tar.bz2 hercules-1935ad18f51f0b72d95411d1ccd24a568e91cc20.tar.xz hercules-1935ad18f51f0b72d95411d1ccd24a568e91cc20.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 |