wiremod / advdupe2

Advanced Duplicator 2
http://wiremod.com
Apache License 2.0
91 stars 61 forks source link

Variable name conflict causing dupes to break after #439 #441

Closed wrefgtzweve closed 1 year ago

wrefgtzweve commented 1 year ago

Duping some things like wire teleporters now errors with addons/advdupe2/lua/advdupe2/sv_clipboard.lua:1273: bad argument #2 to '__add' (Vector expected, got table)

Denneisk commented 1 year ago

This might be unrelated to the PR, but either way it's an deeper issue that's been revealed now. https://github.com/wiremod/wire/blob/master/lua/entities/gmod_wire_teleporter.lua#L20 Teleporter defines a field LocalPos. AdvDupe2 stores dupe data directly on the entity, so it's likely it was trying to access this incorrect LocalPos field instead of the AdvDupe2 data.

wrefgtzweve commented 1 year ago

Oh wow, yeah seems like that's the issue, maybe the advdupe2 values should be named better? Although i don't know how that'd work with backwards dupe compat etc

Denneisk commented 1 year ago

Should change the issue title and description to reference that instead, although if you can confirm that it doesn't happen on the previous commit, then that's even more mysterious.

Denneisk commented 1 year ago

Looking deeper into it, it seems this might be due to the implementation of backwards compatibility with AdvDupe1.

dvdvideo1234 commented 1 year ago

@wrefgtzweve

Nope. It does not seem to be my patch that is related only to bone manipulations. Wire teleporter is not a ragdoll :D

wrefgtzweve commented 1 year ago

My bad for that seems like #439 did it, i just didn't have that commit pulled when i tested 😞

wrefgtzweve commented 1 year ago

The issue is still present, that pr didn't solve it for me

[AdvDupe2Notify]    Pasting...
[AdvDupe2Notify]    addons/advdupe2/lua/advdupe2/sv_clipboard.lua:1244: attempt to compare nil with number
[AdvDupe2Notify]    Finished Pasting!

You can replicate it by spawning a wire teleporter, then duping and pasting it with advdupe2, no prior dupes needed

thegrb93 commented 1 year ago

I think the pr fixed it for the Queue'd case (multiplayer), but maybe the singleplayer case isn't fixed.

Denneisk commented 1 year ago

This is from accessing Queue.Revision which gets its value in function AdvDupe2.LoadDupe, in a dupe info struct whose field revision is set in function AdvDupe2.Decode, where that field is impossible to be nil, so this is likely some sort other issue.

SP and MP both use the Queue. I tested in SP.

thegrb93 commented 1 year ago

Hm, maybe check that you're not using the workshop version, @wrefgtzweve ?

wrefgtzweve commented 1 year ago

I'm on commit 7f061801bf7bbdfdb573ed23410591d48c1e93ae, restarted my game, i don't have it on workshop either. I know it doesn't make much sense

Denneisk commented 1 year ago

Are you willing to share the dupe to help? Any other possible points of conflict?

wrefgtzweve commented 1 year ago

Oh wait, looking at the error im getting / posted, it's a different error than before which adds up image [AdvDupe2Notify] addons/advdupe2/lua/advdupe2/sv_clipboard.lua:1244: attempt to compare nil with number

wrefgtzweve commented 1 year ago

Are you willing to share the dupe to help? Any other possible points of conflict?

I mentioned it here, https://github.com/wiremod/advdupe2/issues/441#issuecomment-1786025168 im just copying a newly spawned teleporter, its not a dupe file

wrefgtzweve commented 1 year ago

Okay i see now, i think once you load a dupe file it works fine, but before that any copy paste (no dupe file) is broken

thegrb93 commented 1 year ago

Do you have an addon that's mucking with the Advdupe2 Queue entries? I can't investigate right now, but later I can.

wrefgtzweve commented 1 year ago

I shouldn't have anything like that, my dev env is minimal

wrefgtzweve commented 1 year ago

I'll see if i can get a clip and compress it under githubs 10mb limit

I ended up posting it in the wiremod discord due to filesize https://discord.com/channels/231131817640460288/237764217736921089/1168670511736311908 https://cdn.discordapp.com/attachments/237764217736921089/1168670507961421938/NVIDIA_Share_m1ZHYJkdwR.mp4

Denneisk commented 1 year ago

Okay i see now, i think once you load a dupe file it works fine, but before that any copy paste (no dupe file) is broken

Okay, that is my fault, I should've accounted for that. Sorry for my incorrect assumption that was impossible.

wrefgtzweve commented 1 year ago

No problem, thanks for sticking around and fixing it!