Just reverse the range

This commit is contained in:
Nick Perez
2023-03-13 07:00:51 -04:00
parent b4b24f1389
commit 0dce4c700f

View File

@@ -1504,9 +1504,9 @@ class KoboldStoryRegister(object):
else:
self.actions[i]["Probabilities"][token_num][token_option]["Used"] = False
if "Options" in self.actions[i]:
for option in self.actions[i]["Options"][:]:
if option["text"] == text:
self.actions[i]["Options"].remove(option)
for j in reversed(range(len(self.actions[i]["Options"]))):
if self.actions[i]["Options"][j]["text"] == text:
del self.actions[i]["Options"][j]
if old_text != "":
self.actions[i]["Options"].append({"text": old_text, "Pinned": False, "Previous Selection": False, "Edited": True})
else: