WeatherElectric / Lacrimosum

Risk Of Rain 2-based items for Lethal Company
0 stars 0 forks source link

Ukelele won't stay reeled up when holding left click #4

Closed Lunxara closed 2 months ago

Lunxara commented 2 months ago

Found a new bug with the Ukelele, when holding left click it won't stay reeled back and instead will auto swing. I hope you can fix this ^^

FragileDeviations commented 2 months ago

I tried to and no matter what I did, it’d still happen. I don’t know what causes it, since it’s using the basegame shovel code exactly

XuuXiaolan commented 2 months ago

https://github.com/WeatherElectric/Lacrimosum/blob/main/ItemScripts/Ukulele.cs#L41

If you can't inherit the shovel class it's probably that you're not doing a WaitUntil in this function

Lunxara commented 2 months ago

I tried to and no matter what I did, it’d still happen. I don’t know what causes it, since it’s using the basegame shovel code exactly

Well whatever you're doing also causes knives to damage the player holding them when they swing it, so I imagine some code is being used wrong? I'm not sure. Hopefully Xu's suggestion will help ^^

FragileDeviations commented 2 months ago

I tried to and no matter what I did, it’d still happen. I don’t know what causes it, since it’s using the basegame shovel code exactly

Well whatever you're doing also causes knives to damage the player holding them when they swing it, so I imagine some code is being used wrong? I'm not sure. Hopefully Xu's suggestion will help ^^

How? I'm not even touching knives.

FragileDeviations commented 2 months ago

https://github.com/WeatherElectric/Lacrimosum/blob/main/ItemScripts/Ukulele.cs#L41

If you can't inherit the shovel class it's probably that you're not doing a WaitUntil in this function

Can't inherit shovel, WaitUntil caused a compile error that would not go away because it can't be converted to a Func

FragileDeviations commented 2 months ago

I tried to and no matter what I did, it’d still happen. I don’t know what causes it, since it’s using the basegame shovel code exactly

Well whatever you're doing also causes knives to damage the player holding them when they swing it, so I imagine some code is being used wrong? I'm not sure. Hopefully Xu's suggestion will help ^^

Tested and the knife problem is not happening to me with just this mod. It's likely another mod causing it.

XuuXiaolan commented 2 months ago

Try doing something like this yield return new WaitUntil(() => boolean);

FragileDeviations commented 2 months ago

Try doing something like this yield return new WaitUntil(() => boolean);

The problem is the original code is trying to use a coroutine for the WaitUntil. The compiler is not liking that, and the original code seems to be doing that somehow.

FragileDeviations commented 2 months ago

Found it, yield return new WaitUntil(() => !shovel.isHoldingButton);

Dotpeek had some weirdness with the decompiled assembly and caused it to use itself as a reference

FragileDeviations commented 2 months ago

Fixed in v1.4.1

Lunxara commented 2 months ago

I tried to and no matter what I did, it’d still happen. I don’t know what causes it, since it’s using the basegame shovel code exactly

Well whatever you're doing also causes knives to damage the player holding them when they swing it, so I imagine some code is being used wrong? I'm not sure. Hopefully Xu's suggestion will help ^^

Tested and the knife problem is not happening to me with just this mod. It's likely another mod causing it.

Yeah my bad it ended up being a weird bug with BioDiversity, I had to go double check the mods that updated after you said it wasn't your mod and isolate it cus somehow I just couldn't repro it that one time with your mod disabled cus I got lucky :3