From baedf0acad898c0f46923c4fe848f886eb3031a1 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sun, 12 Oct 2008 10:31:05 +0000 Subject: - 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 --- src/map/chrif.c | 26 ++++++++++++++++---------- 1 file 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; } /*========================================== -- cgit v1.2.3-70-g09d2