ViciousSquid / Dosidicus

Tamagotchi-style digital pet with a neural network and Hebbian learning
5 stars 1 forks source link

CRASH when saving a game with placed decorations #6

Closed ViciousSquid closed 4 months ago

ViciousSquid commented 4 months ago

Placing a decoration object into the play area raises a TypeError when user attempts to save:

TypeError: Object of type QPointF is not JSON serializable

Attempting to launch the app with a saved game present will crash to the following error:

raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 25 column 20 (char 14594)

ViciousSquid commented 4 months ago

Fixed code, item.pos() is replaced with (item.pos().x(), item.pos().y()), which converts the QPointF object to a tuple of floats

ViciousSquid commented 4 months ago

Decoration items are now saved and loaded correctly. Fixed in two hours ...... jammy :-p