Telescopes edge-case crash on load (incl. code)


Mobbstar
  • Version: PC/MAC/Linux Fixed

Spyglasses ("telescope" in code) can crash the game of load if their last use has been cut short by quitting the game.

The reason for this crash is that they don't remove on finish instantly:


local function onfinished(inst)
	local user = inst.components.inventoryitem:GetGrandOwner()
	user:ListenForEvent("animover", function() 
		inst:Remove()
	end)
end

As you can see, they wait until the animation ends. By quitting, they never get the chance to remove themselves. When loading again, they'll run onfinished() again but not find a user because that's not loaded yet, effectively crashing the game.

A simple solution is to check if a user exists and instantly remove them if not.


Steps to Reproduce
Use a spyglass (any) with only one use left Pause before the animation finishes Quit the game Load the savefile Crash (line 60 in telescope.lua, code shown above)

Status: Fixed

This issue has been fixed in either a future version or updated in a previous version.


  Report Bug


User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
....


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now