aikaterna / gobcog

RPG Adventure Cog for Red v3
44 stars 68 forks source link

[Command Bug] negaverse steals normal/rare/epic items #449

Closed jackpoz closed 7 months ago

jackpoz commented 10 months ago

Complete these first

Command name

negaverse

Expected Behavior

negaverse shouldn't steal normal/rare/epic items stored in the backpack

Current Behavior

normal/rare/epic items are stolen from the backpack when using negaverse command. This started to happen some months ago, it wasn't always like that

Adventure version: 4.0.4 Repo: https://github.com/aikaterna/gobcog.git Commit: 4823374f48d4e2d74a01049cfd2eb77791464a39

Possible Solution

https://github.com/aikaterna/gobcog/blob/4823374f48d4e2d74a01049cfd2eb77791464a39/adventure/negaverse.py#L219 specifies the exclude parameter with strings, but https://github.com/aikaterna/gobcog/blob/4823374f48d4e2d74a01049cfd2eb77791464a39/adventure/charsheet.py#L732-L734 then mixes a bit of strings and enums. Not sure if this mismatch can cause issues, with the code checking rarety comparing wrong values.

Steps to Reproduce

  1. "loot normal" and store at least 1 normal item in the backpack
  2. "negaverse" going all in with all the gold and lose. The "lose" part might require a few tries
  3. Notice how the normal item will be stolen

Context (Environment)

This is an unexpected behavior as I played for years with normal items in the backpack without them being stolen

aikaterna commented 10 months ago

This is intended.

jackpoz commented 10 months ago

What's the point of exclude={"event", "normal", "rare", "epic"} then if no items are excluded ?

aikaterna commented 10 months ago

Someone can check it out when they have time, moving a reference to the tracker

jackpoz commented 9 months ago

I opened a PR fixing the issue

jackpoz commented 7 months ago

this is actually happening again image image

jackpoz commented 7 months ago

Ah well, it seems to be the new behavior with f28512e4dae27653221ba37aa990e1f82e10a3a0