From 97e1760af5d38ae191d0b53810424983d24eb5ed Mon Sep 17 00:00:00 2001 From: Gnome Ann <> Date: Tue, 28 Sep 2021 01:07:11 -0400 Subject: [PATCH] Prevent retry from popping chunks after edit/delete --- aiserver.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aiserver.py b/aiserver.py index d37eb810..7ee18541 100644 --- a/aiserver.py +++ b/aiserver.py @@ -937,6 +937,7 @@ def actionsubmit(data, actionmode=0): set_aibusy(1) vars.recentback = False + vars.recentedit = False vars.actionmode = actionmode # "Action" mode @@ -993,13 +994,14 @@ def actionretry(data): # Remove last action if possible and resubmit if(vars.gamestarted if vars.useprompt else len(vars.actions) > 0): set_aibusy(1) - if(not vars.recentback and len(vars.actions) != 0 and len(vars.genseqs) == 0): # Don't pop if we're in the "Select sequence to keep" menu or if there are no non-prompt actions + if(not vars.recentback and not vars.recentedit and len(vars.actions) != 0 and len(vars.genseqs) == 0): # Don't pop if we're in the "Select sequence to keep" menu or if there are no non-prompt actions last_key = vars.actions.get_last_key() vars.actions.pop() remove_story_chunk(last_key + 1) vars.genseqs = [] calcsubmit('') vars.recentback = False + vars.recentedit = False elif(not vars.useprompt): emit('from_server', {'cmd': 'errmsg', 'data': "Please enable \"Always Add Prompt\" to retry with your prompt."}) @@ -1548,6 +1550,7 @@ def editrequest(n): # #==================================================================# def editsubmit(data): + vars.recentedit = True if(vars.editln == 0): vars.prompt = data else: @@ -1576,6 +1579,7 @@ def deleterequest(): # #==================================================================# def inlineedit(chunk, data): + vars.recentedit = True chunk = int(chunk) if(chunk == 0): if(len(data.strip()) == 0): @@ -1592,6 +1596,7 @@ def inlineedit(chunk, data): # #==================================================================# def inlinedelete(chunk): + vars.recentedit = True chunk = int(chunk) # Don't delete prompt if(chunk == 0):