ZioPao / The-Only-Cure

Amputation mod for Project Zomboid
GNU General Public License v3.0
11 stars 7 forks source link

MP - two handed weapon is rendered incorectlly for other players #119

Open m-hynek opened 2 months ago

m-hynek commented 2 months ago

Describe the bug image

To Reproduce

Logs Nothing there

Additional context Tried with and without fancy+brutal with same result

ZioPao commented 2 months ago

Wait, just to be sure that I'm understanding this correctly before dwelving into debugging, are you using a single baseball bat and it shows as two?

m-hynek commented 2 months ago

Yes that is the case. Not only baseball bats, but even brooms and basicaly every two handed item is duplicated, seems it doesnt matter what hand is amputated. One player just reported some weid behavior when holding gas can and refueling, but im confused by their details, will test a bit and get back here with more details

m-hynek commented 2 months ago

Wait, just to be sure that I'm understanding this correctly before dwelving into debugging, are you using a single baseball bat and it shows as two?

you can see yourself correctly, others see you with duplicated weapon

ZioPao commented 2 months ago

Ok, I confirmed it on my end. It's related to Brutal\Fancy Handwork though, not TOC, and it happens only when you cut off the left limb, not the right one. I'll see if it's fixable on my end, but no promises

EDIT: It's a bug\incompatibility with Brutal Handwork, Fancy alone works fine.

m-hynek commented 2 months ago

My bad, on the screen there is left hand prosthetic. But also fancy and brutal are deactivated.

ZioPao commented 2 months ago

I didn't manage to reproduce it anymore, it happened only twice, but after unequipping and re-requipping it stopped. I seem to be missing something.

m-hynek commented 2 months ago

Maybe when other player equips weapon offscreen. When they already weild weapon when cllient "renders" them, it missing something that hapends clientside in TOC. If it makes sense. Is there some modified Equip item/weapon action? That would make sense because that code would run for the other player in your client only if you see them right? Just blind shot, I dont know yet how everyting works in TOC

ZioPao commented 2 months ago

Maybe when other player equips weapon offscreen. When they already weild weapon when cllient "renders" them, it missing something that hapends clientside in TOC. If it makes sense. Is there some modified Equip item/weapon action? That would make sense because that code would run for the other player in your client only if you see them right? Just blind shot, I dont know yet how everyting works in TOC

Not sure about the off-screen thing, it happened to me when I had that other client on my screen. About the equip action, I've already checked it. The methods used are ISEquipWeaponAction:perform and ISEquipWeaponAction:performWithAmputation. Unfortunately, they run only on the actual client, then the actions are synced through the server. But yes, there must be something missing there, not sure what as of now.

m-hynek commented 2 months ago

Or there is difference equipping from hotbar and trough contextmenu. Anyway when that amputee player come online, we will do some testing and I will get back here with some more observations

m-hynek commented 2 months ago

Hmm I was onto something. We did some tests.

me: observing player2: equiping and unequiping, prosthetic left hand

test 1 weapon: crowbar weapon in inventory/ground (same result) player add it to Back slot (hotbar 1) player equips crowbar trough hotbar 1 result: OK

test 2 weapon: crowbar weapon in inventory/ground (same result) player right clicks the weapon on ground/inventory, and in context menu selects "equip in both hands" result: FAIL - weapon is duplicated, looks like dual wielding (original screenshot)

test 3 weapon: sledgehammer weapon in inventory/ground (same result) hotbar method reult: OK

test 4 weapon: sledgehammer weapon in inventory/ground (same result) context menu method reult: FAIL, even weirder (player is holding right click to aim) image

test 4 weapon: crowbar weapon in inventory/ground (same result) context menu method, but main or off hand instead of both hands reult: OK