diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-10-12 10:31:05 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-10-12 10:31:05 +0000 |
commit | baedf0acad898c0f46923c4fe848f886eb3031a1 (patch) | |
tree | a05d19fb6777b13b02fda672d993033aff08a66b /src | |
parent | ea85e8388481642e7b468361a4bd06f410a7ec0a (diff) | |
download | hercules-baedf0acad898c0f46923c4fe848f886eb3031a1.tar.gz hercules-baedf0acad898c0f46923c4fe848f886eb3031a1.tar.bz2 hercules-baedf0acad898c0f46923c4fe848f886eb3031a1.tar.xz hercules-baedf0acad898c0f46923c4fe848f886eb3031a1.zip |
- Fixed divorce should work on both partners. Bug Report #2339.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13284 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/chrif.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index cffc24726..089d70492 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -897,19 +897,25 @@ int chrif_divorceack(int char_id, int partner_id) struct map_session_data* sd; int i; - if (!char_id || !partner_id || (sd = map_charid2sd(char_id)) == NULL || sd->status.partner_id != partner_id) + if( !char_id || !partner_id ) return 0; - // Update Partner info - sd->status.partner_id = 0; - - // Remove Wedding Rings from inventory - for(i = 0; i < MAX_INVENTORY; i++) - if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F) - pc_delitem(sd, i, 1, 0); - - //TODO: send clif_divorced() + if( (sd = map_charid2sd(char_id)) != NULL && sd->status.partner_id == partner_id ) + { + sd->status.partner_id = 0; + for(i = 0; i < MAX_INVENTORY; i++) + if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F) + pc_delitem(sd, i, 1, 0); + } + if( (sd = map_charid2sd(partner_id)) != NULL && sd->status.partner_id == char_id ) + { + sd->status.partner_id = 0; + for(i = 0; i < MAX_INVENTORY; i++) + if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F) + pc_delitem(sd, i, 1, 0); + } + return 0; } /*========================================== |