diff options
author | Haru <haru@dotalux.com> | 2019-09-22 20:02:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-22 20:02:01 +0200 |
commit | 76896e85057760d7f412293b912dce77d9016415 (patch) | |
tree | bd0dc1ae096fd92ea852ef81600ce5da5e5a24a5 /src/map/pc.c | |
parent | 63d93d45038ab070dcb8e4714fb72c99fdcf2e9c (diff) | |
parent | 4e093cebcb83bab380dc655bb951de1e2d14c73c (diff) | |
download | hercules-76896e85057760d7f412293b912dce77d9016415.tar.gz hercules-76896e85057760d7f412293b912dce77d9016415.tar.bz2 hercules-76896e85057760d7f412293b912dce77d9016415.tar.xz hercules-76896e85057760d7f412293b912dce77d9016415.zip |
Merge pull request #2524 from MishimaHaruna/homunculus-fixes
Homunculus related fixes
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index a2ed4fb8a..8ac820d79 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1536,17 +1536,16 @@ static int pc_reg_received(struct map_session_data *sd) if (sd->status.guild_id) guild->member_joined(sd); - // pet - if (sd->status.pet_id > 0) - intif->request_petdata(sd->status.account_id, sd->status.char_id, sd->status.pet_id); - - // Homunculus [albator] - if( sd->status.hom_id > 0 ) - intif->homunculus_requestload(sd->status.account_id, sd->status.hom_id); - if( sd->status.mer_id > 0 ) - intif->mercenary_request(sd->status.mer_id, sd->status.char_id); - if( sd->status.ele_id > 0 ) - intif->elemental_request(sd->status.ele_id, sd->status.char_id); + if (sd->state.standalone == 0 && sd->state.autotrade == 0) { // prevents loading pets, homunculi, mercenaries or elementals if the character doesn't have a client attached + if (sd->status.pet_id != 0) + intif->request_petdata(sd->status.account_id, sd->status.char_id, sd->status.pet_id); + if (sd->status.hom_id != 0) + intif->homunculus_requestload(sd->status.account_id, sd->status.hom_id); + if (sd->status.mer_id != 0) + intif->mercenary_request(sd->status.mer_id, sd->status.char_id); + if (sd->status.ele_id != 0) + intif->elemental_request(sd->status.ele_id, sd->status.char_id); + } map->addiddb(&sd->bl); map->delnickdb(sd->status.char_id, sd->status.name); @@ -7765,7 +7764,7 @@ static int pc_resetskill(struct map_session_data *sd, int flag) pc->setoption(sd, i); if( homun_alive(sd->hd) && pc->checkskill(sd, AM_CALLHOMUN) ) - homun->vaporize(sd, HOM_ST_REST); + homun->vaporize(sd, HOM_ST_REST, true); if ((sd->sc.data[SC_SPRITEMABLE] && pc->checkskill(sd, SU_SPRITEMABLE))) status_change_end(&sd->bl, SC_SPRITEMABLE, INVALID_TIMER); @@ -8006,7 +8005,7 @@ static void pc_damage(struct map_session_data *sd, struct block_list *src, unsig if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support ) pet->target_check(sd,src,1); - if( sd->status.ele_id > 0 ) + if (sd->status.ele_id != 0 && sd->ed != NULL) elemental->set_target(sd,src); if (battle_config.prevent_logout_trigger & PLT_DAMAGE) @@ -8054,7 +8053,7 @@ static int pc_dead(struct map_session_data *sd, struct block_list *src) if (sd->status.hom_id > 0){ if(battle_config.homunculus_auto_vapor && sd->hd) - homun->vaporize(sd, HOM_ST_REST); + homun->vaporize(sd, HOM_ST_REST, true); } if( sd->md ) @@ -9069,7 +9068,7 @@ static int pc_jobchange(struct map_session_data *sd, int class, int upper) pc->setoption(sd, i); if(homun_alive(sd->hd) && !pc->checkskill(sd, AM_CALLHOMUN)) - homun->vaporize(sd, HOM_ST_REST); + homun->vaporize(sd, HOM_ST_REST, true); if ((sd->sc.data[SC_SPRITEMABLE] && pc->checkskill(sd, SU_SPRITEMABLE))) status_change_end(&sd->bl, SC_SPRITEMABLE, INVALID_TIMER); |