I found a BUG that can cause the game to crash in severe cases. This time I'm talking about 《BigBrother_AnotherStory-0.09.2.03-pc》. The specific manifestation is as follows: After purchasing items, when the courier delivers the goods, a large number of duplicate item names will appear on the item list. If you purchase a relatively large number of items at one time, the length of the list will exceed the limit and the game will crash directly.
The location of the problematic code is on line 406 of the game file game\core\04function.rpy (The game error will appear on line 591 of game\events\max.rpy. Because in the 04function.rpy file, an inappropriate temporary global definition "TmpName" is made on line 406 to temporarily store the item names. This approach leads to the situation where sometimes you will find a large number of duplicate item names, and sometimes not. This pollutes the global environment and also increases the difficulty of maintenance. However, I have already fixed it for the author. The specific details are as follows:
The original code from line 391 to line 408 should be replaced with the following code:
def GetDeliveryString(courier):
StrDev = __("Так... В накладной написано следующее:")
added_names = set()
for i in delivery_list[courier]:
item_name = items.name
if item_name not in added_names:
items.bought = False
items.have = True
StrDev += "\n \"{}\"".format(__ (item_name))
added_names.add(item_name)
return StrDev
def DeletingDeliveryTempVar(courier):
delivery_list[courier].clear()
Replying here may disrupt the indentation of the code. Therefore, if you want to replace the original code, please pay attention to this issue.