summaryrefslogtreecommitdiff
path: root/src/map/pc.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-11-04 22:28:16 -0800
committerBen Longbons <b.r.longbons@gmail.com>2014-11-04 22:28:16 -0800
commit0bc322efc087ab0c7b53709e5e20ac76aee761de (patch)
treec656fb93447bc7268920f020c8459c7392abce6d /src/map/pc.cpp
parentad98bbcff7d6385dbcc4b2c7d393c7f16420ebdd (diff)
downloadtmwa-0bc322efc087ab0c7b53709e5e20ac76aee761de.tar.gz
tmwa-0bc322efc087ab0c7b53709e5e20ac76aee761de.tar.bz2
tmwa-0bc322efc087ab0c7b53709e5e20ac76aee761de.tar.xz
tmwa-0bc322efc087ab0c7b53709e5e20ac76aee761de.zip
Perform divorces asynchronously to avoid crashes
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r--src/map/pc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 1e7d295..70c9087 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -4709,15 +4709,12 @@ int pc_divorce(dumb_ptr<map_session_data> sd)
}
p_sd->status.partner_id = CharId();
sd->status.partner_id = CharId();
-
- if (sd->npc_flags.divorce)
- {
- sd->npc_flags.divorce = 0;
- map_scriptcont(sd, sd->npc_id);
- }
}
else
+ {
+ sd->status.partner_id = CharId();
chrif_send_divorce(sd->status_key.char_id);
+ }
return 0;
}