mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 22:29:18 +00:00
because savegame.get_line() will consume the line, but eof_reached will only be reached when trying to read the next line the code inside the while gets called twice for the last line.
Which wouldn't be a problem, except currentline.parse_json(null) does not alter currentline.
I think an even better way would be
```
while (!savegame.eof_reached()):
var line = savegame.get_line()
if not line:
continue
currentline.parse_json(line)
# Remaining code here
```