Jump to content

Blessed Sisturn II's buff doesn't account for players despawning


hoxi
  • Pending

Got this in my server log:

Stale Component Reference: GUID 119393, scripts/prefabs/wendy.lua:141

 

So I checked, this bit here is missing an IsValid check:

	-- REMOVE PLAYERS NOW MISSING
	for _, player in ipairs(oldlist) do
		if player.components.sanity then
			local quit = true
			for _, newplayer in ipairs(newlist) do
				if player == newplayer then
					quit = false
					break
				end
			end
			if quit then
				local fx = SpawnPrefab("wendy_sanityaura_buff_off_fx")
				player.SoundEmitter:PlaySound("meta5/wendy/sisturn_sanity_buff_pst")
				player:AddChild(fx)
				player.components.sanity.neg_aura_modifiers:RemoveModifier(inst, "wendyskill"..inst.GUID)
			end
		end
	end

I'm surprised the SoundEmitter call doesn't cause a crash, but it does log that message which is good. Though what's worrying is the AddChild call, despite calling child.entity:SetParent(self.entity), it neither crashes nor logs anything..

 

Additionally, while the sanity modifier does get removed if the Wendy player despawns (due to the Wendy inst being used as the source), there's no accounting for the skill being deactivated (even if this really shouldn't happen normally), this means the buff could be stuck on players until Wendy despawns or the buffed players despawn. Also, players that lose the buff due to Wendy despawning will get no indication that they lost it.

Players in the list of sanityadjuster need to be processed to be unregistered when the skill is deactivated or if Wendy despawns.


Steps to Reproduce

For the stale component reference issue:

  • Have a Wendy with the Blessed Sisturn II skill active, and an active Sisturn.
  • Have a player gain the buff.
  • Have that same player disconnect, with Wendy staying close to keep the buff on them.
  • Check the server log file.

 

For the issue with the buff persisting when disabling the skill:

  • Have a Wendy with the Blessed Sisturn II skill active, and an active Sisturn.
  • Have a player gain the buff.
  • Deactivate the skill (through debug functions), with Wendy staying close to keep the buff on them.
  • Notice how the other player will still benefit from the buff. Even if they move away from Wendy.
  • Reacquire the skill.
  • Notice how this will correct it.

 

For the issue where Wendy despawning results in no indication of the buff being disabled:

  • Have a Wendy with the Blessed Sisturn II skill active, and an active Sisturn.
  • Have a player gain the buff.
  • Have the Wendy player disconnect, with Wendy staying close to keep the buff on them.
  • Notice how there's no indication for the other player that they lost the buff.



User Feedback


There are no comments to display.



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

×
  • Create New...