Closed wrefgtzweve closed 1 year ago
I can confirm the problem
@wrefgtzweve @HavannaFR you likely have an addon causing the issue. Can you add debug.Trace()
at this place https://github.com/wiremod/advdupe2/blob/master/lua/weapons/gmod_tool/stools/advdupe2.lua#L762 and tell us what the console prints when the issue happens.
I've done that, i got more proof on the wire discord https://discord.com/channels/231131817640460288/237764217736921089/1069073763385225297
Added it through a detour thus the runstring (i was holding a crowbar at the time)
AdvDupe2_RemoveGhosts = AdvDupe2_RemoveGhosts or AdvDupe2.RemoveGhosts
function AdvDupe2.RemoveGhosts()
AdvDupe2_RemoveGhosts()
debug.Trace()
end
Can you see if adding if self:GetOwner()~=LocalPlayer() then return end
in that spot fixes the issue?
Kind of looks like your gmod_tool code might be out of date as well. Your trace shows 325 as the ReleaseGhost call, but it's on line 327. https://github.com/Facepunch/garrysmod/blob/master/garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua#L327
seems like it's the holster function that's different
I think that's because the latest commit isn't in gmod yet
Can you see if adding
if self:GetOwner()~=LocalPlayer() then return end
in that spot fixes the issue?
seems to runs for other players too, as the issue states gets called when any player in the game dies or drops a weapon
will try though
Can you open a garrysmod-issue about it? 'Clientside SWEP:OwnerChanged getting called on local player's swep when other players switch weapons', and reference this issue?
Can you see if adding
if self:GetOwner()~=LocalPlayer() then return end
in that spot fixes the issue?
seems to only print when i die with the tool out, not when the dupe is getting cleared, doesn't make much sense
Oh, so something else is maybe clearing the ghosts?
it's hard to test live, i'll see if i can get another player in a clean dev enviroment to test
If there's a new problem since friday, it's more likely to be caused by this: https://github.com/Facepunch/garrysmod/commit/165a5e19996b2f94b4d9a65da639b3aaf560e77e
Although I do not see a reason it would affect a player by other players doing anything.
My guess is that it's because https://github.com/Facepunch/garrysmod/blob/f49947b238183e0929f47dcb882553478662f9d9/garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua#L323 this gets called for everyone, not just the player thats holding the toolgun i think
Hmm, I see. It does indeed get called on all clients clientside sometimes, and the recent changes to GetToolObject()
make the bug happen.
I will get that sorted on the toolguns end.
This is now fixed within gmod, thanks robotboy!
OwnerChanged
always gets called when any player in the game dies or drops a weapon Also seems to happen when any player holsters a swep https://github.com/Facepunch/garrysmod/blob/b6c4159bbe8b95591c8189a27d7fa68d607aeebf/garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/stool.lua#L127which calls
ReleaseGhostEntity
which then clears all ghosts.This happens quite often on larger populated servers and makes advdupe2 pretty hard if not impossible to properly use.
https://user-images.githubusercontent.com/69946827/215128812-6bc86bab-833c-4934-b646-b25f858f189f.mp4