summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-16 13:56:19 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-16 13:56:19 -0600
commit68c3337b48956e286ce8539e164c46eb91e96687 (patch)
tree1c0ba4007fcbf4d9730b3e1351e8e8b5f7a18fc8
parentd450f9fd7b5d4fd71d4f7e244ef9d0786d0f745a (diff)
downloadtmwa-68c3337b48956e286ce8539e164c46eb91e96687.tar.gz
tmwa-68c3337b48956e286ce8539e164c46eb91e96687.tar.bz2
tmwa-68c3337b48956e286ce8539e164c46eb91e96687.tar.xz
tmwa-68c3337b48956e286ce8539e164c46eb91e96687.zip
Only resume script after divorce if need to
-rw-r--r--src/map/chrif.c6
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/script.c5
4 files changed, 15 insertions, 3 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index ef681b7..40972f4 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -692,7 +692,11 @@ int chrif_divorce(int char_id, int partner_id)
sd = map_nick2sd(map_charid2nick(char_id));
if (sd && sd->status.partner_id == partner_id) {
sd->status.partner_id = 0;
- map_scriptcont(sd, sd->npc_id);
+
+ if (sd->npc_flags.divorce) {
+ sd->npc_flags.divorce = 0;
+ map_scriptcont(sd, sd->npc_id);
+ }
}
nullpo_retr(0, sd = map_nick2sd(map_charid2nick(partner_id)));
diff --git a/src/map/map.h b/src/map/map.h
index a81d15d..a3dbb03 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -208,6 +208,7 @@ struct map_session_data {
char npc_str[256];
struct {
unsigned storage : 1;
+ unsigned divorce : 1;
} npc_flags;
unsigned int chatID;
diff --git a/src/map/pc.c b/src/map/pc.c
index 8dfdf47..67e280b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -6695,7 +6695,11 @@ int pc_divorce(struct map_session_data *sd)
}
p_sd->status.partner_id=0;
sd->status.partner_id=0;
- map_scriptcont(sd, sd->npc_id);
+
+ if (sd->npc_flags.divorce){
+ sd->npc_flags.divorce = 0;
+ map_scriptcont(sd, sd->npc_id);
+ }
}
else
chrif_send_divorce(sd->status.char_id);
diff --git a/src/map/script.c b/src/map/script.c
index 287b4f6..b8e07eb 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5265,11 +5265,14 @@ int buildin_divorce(struct script_state *st)
struct map_session_data *sd=script_rid2sd(st);
st->state=STOP; // rely on pc_divorce to restart
-
+
+ sd->npc_flags.divorce = 1;
+
if(sd==NULL || pc_divorce(sd) < 0){
push_val(st->stack,C_INT,0);
return 0;
}
+
push_val(st->stack,C_INT,1);
return 0;
}