diff options
author | Mathy <MathyM@users.noreply.github.com> | 2019-08-25 20:17:00 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2019-08-26 01:22:12 +0200 |
commit | 4e093cebcb83bab380dc655bb951de1e2d14c73c (patch) | |
tree | 3d93c96962a74045f5e7a165403e4ae7a19be05a /src/map/pc.c | |
parent | 2bee596ad0bb84a92d878d3d76993ba365c70e2b (diff) | |
download | hercules-4e093cebcb83bab380dc655bb951de1e2d14c73c.tar.gz hercules-4e093cebcb83bab380dc655bb951de1e2d14c73c.tar.bz2 hercules-4e093cebcb83bab380dc655bb951de1e2d14c73c.tar.xz hercules-4e093cebcb83bab380dc655bb951de1e2d14c73c.zip |
Prevent pets, homunculi etc. from being loaded if the character doesn't have a client attached to it (e.g. is autotrading).
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index b0c77049c..9ca35acce 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); @@ -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) |