Closed Achang0611 closed 4 months ago
I apologize for the typo; please consider "alert" as "assert".
Many inventory operations were also affected by this issue, and I manually replaced all assert statements with the revised operation mentioned above. The game is now running smoothly.
This is a very good point, I think there's a lot of bad assert
usage in the code. I'll have to go through all of them and make corrections.
Program execution statements should not be placed inside an alert; otherwise, the program will not execute in the release version.
Expected Behavior
The item images are displayed in the release version of the game.
Current Behavior
I found that the "item" images in my game disappeared in the release version, while other images displayed normally. After debugging, I discovered that in the
parse
function ofItemProtoset
,test_json_conv.data
was not null in the debug version but was null in the release version. Then, outputtingtest_json_conv.parse(json) == OK
returned true, indicating that the JSON parsed correctly.Possible Solution
Next, I changed the original code snippet at item_protoset.gd
to the revised code snippet:
The game then displayed item images correctly in the release version.