steviegt6 / terraclient

Fork of tModLoader, modern Terraria utility client offering many native features.
Other
52 stars 10 forks source link

[BUG] Deadly modifier with reforging. #87

Open MrWomanStealer opened 3 years ago

MrWomanStealer commented 3 years ago

The issue

This bug involves the .reforge command and being used with the deadly modifier.

Reproduction steps

Steps to reproduce the behavior: Pick up a weapon that can support the deadly modifier (like a bow) type .reforge deadly You will now see 2 deadly's, and can't choose between them

Expected behavior

The deadly modifier being applied to a bow.

Comprehensive information

If you press enter it will give a random modifier or just remove the modifier fully.

Hardware & software information

steviegt6 commented 3 years ago

This is probably an issue with duplicate reforges in the game's code (i.e. a scrapped earlier "Deadly" modifier). I'll take a look at this later.

MarauderKnight3 commented 3 years ago

(Steviegt6,) The reforge command takes valid input for a prefix and compares it to a list of prefixes that were hand-written and placed in an array static readonly string[] MystagogueCommand.Prefixes, getting the index of the matching name and applying that index as a prefix to the weapon. (Making my own list was the fastest, also a lazy option) IndexOf should return the first one the game finds when it recognizes you choose deadly. I'm going to also look at the command input digester later but it's got nothing to do with negative IDs, discard IDs or anything else of that sort, as the prefix list was handwritten from what's allowed in game

Edit: Also, a check for ids 20 and 43 is made where it checks for melee/ranged status on the weapon before it chooses what ID to use. Image image

Edit 2: I think it has something to do with the big spaghetti storm that is Item.Prefix().

Edit 3: changes

MarauderKnight3 commented 3 years ago

@GooUckd Can I ask what item you were trying to reforge?

MrWomanStealer commented 3 years ago

@GooUckd Can I ask what item you were trying to reforge?

A silver bow. I tried another bow which I can't remember. Also, tried the clockwork assault rifle. Same issue.