Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made viewEntity reset only if current one matches set one. Fixes: #1378 #1380

Closed
wants to merge 2 commits into from

Conversation

thegrb93
Copy link
Owner

@thegrb93 thegrb93 commented Aug 13, 2022

Fixes: #1378

Comment on lines -88 to -96
if SERVER then
instance:AddHook("deinitialize", function()
for k, ply in pairs(player.GetAll()) do
if SF.IsHUDActive(instance.entity, ply) then
ply:SetViewEntity()
end
end
end)
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was actually needed, because fun fact, Starfall doesn't actually disconnect you from a HUD when the chip is removed lol.
Maybe do this instead:
lua/starfall/libs_sh/builtins.lua:47

if SERVER then
	instance:AddHook("deinitialize", function()
		for _, ply in pairs(player.GetAll()) do
			if SF.IsHUDActive(instance.entity, ply) then
				SF.EnableHud(ply, instance.entity, nil, false, true)
			end
		end
	end)
end

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also send a signal that doesn't rely on chip being valid, solely to inform players that HUD was disconnected, since right now they won't see the Starfall HUD disconnected by Name. chat message.

@thegrb93
Copy link
Owner Author

Will fix soon

@thegrb93 thegrb93 closed this Jan 4, 2023
@thegrb93 thegrb93 deleted the fix-view-entity branch January 3, 2024 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Starfall always resets 'ViewEntity' when disconnecting from a HUD
2 participants