summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-22 00:18:41 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-22 00:18:41 +0000
commitd22ee8c44edd2ae3574cc818536ef096e9413b98 (patch)
tree0cf28804bdc7872f526211abe6a6ecbb107b23f1
parentd5757f74134b4c00eb055aa75f52eb38c13b9b92 (diff)
downloadhercules-d22ee8c44edd2ae3574cc818536ef096e9413b98.tar.gz
hercules-d22ee8c44edd2ae3574cc818536ef096e9413b98.tar.bz2
hercules-d22ee8c44edd2ae3574cc818536ef096e9413b98.tar.xz
hercules-d22ee8c44edd2ae3574cc818536ef096e9413b98.zip
- Fixed pets/homunc trying to be deleted twice when they had 0 intimacy and their master logs out.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9290 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/unit.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 797922b07..bac0dffd0 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/11/21
+ * Fixed pets/homunc trying to be deleted twice when they had 0 intimacy and
+ their master logs out. [Skotlex]
* Added support for specifying ammo type = 99 in the skill_require_db file,
it can be used to specify that any kind of ammo can be used with the skill,
but you NEED to have ammo equipped. [Skotlex]
diff --git a/src/map/unit.c b/src/map/unit.c
index 81aa1c3b9..6e3c66288 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1643,7 +1643,9 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
md->state.skillstate= MSS_IDLE;
} else if (bl->type == BL_PET) {
struct pet_data *pd = (struct pet_data*)bl;
- if(pd->pet.intimate <= 0) {
+ if(pd->pet.intimate <= 0 &&
+ !(pd->msd && pd->msd->state.waitingdisconnect)
+ ) { //If logging out, this is deleted on unit_free
clif_clearchar_area(bl,clrtype);
map_delblock(bl);
unit_free(bl,0);
@@ -1652,9 +1654,9 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
}
} else if (bl->type == BL_HOM) {
struct homun_data *hd = (struct homun_data *) bl;
- struct map_session_data *sd = hd->master;
- if(!sd || !hd->homunculus.intimacy)
- { //He's going to be deleted.
+ if(!hd->homunculus.intimacy &&
+ !(hd->master && hd->master->state.waitingdisconnect)
+ ) { //If logging out, this is deleted on unit_free
clif_emotion(bl, 28) ; //sob
clif_clearchar_area(bl,clrtype);
map_delblock(bl);