rtakehara / 5e-Framework

A comprehensive 5th Edition Dungeons & Dragons Framework for MapTool.
GNU Affero General Public License v3.0
52 stars 9 forks source link

Creating Monster/NPC token, list incorrectly filters "duplicates" that are not duplicates #17

Closed git-steve-git closed 4 years ago

git-steve-git commented 4 years ago

Describe the bug When creating a new monster token using the "NPC" menu, the drop down of monsters to choose from appears to be eliminating "duplicates" by fuzzy matching anything that starts with a known monster's name.

For example, there are two monsters in the MM named "jackal" and "jackawere." I've imported statblocks for each into the bestiary, but when I go to add an NPC statblock to a new token, only "jackal" appears in the drop down. "Jackalwere" does not.

Likewise, "gnoll" appears, but "gnoll pack lord" does not. And so on. Any monster whose name starts with a string that matches another monster's complete name gets hidden, presumably because the code sees them as duplicates and eliminates the longer one.

To Reproduce Using Framework v2.4.7

  1. Open Settings > bestiary
  2. Import statblocks for at least two creatures, one of whose name is a subset of the other.
  3. Drag and drop a new token into maptool
  4. Open Menu > NPC
  5. Click "OK" to continue
  6. Open the drop down to choose which monster you want to add to the token
  7. Search for the monsters just imported, whose names are similar

Expected behavior All monsters should appear in the drop down,

Actual behaviour Only the first monster appears (eg: "gnoll"). Any additional monsters whose names begin with the same string but are longer (eg: "gnoll pack lord") will not appear.

Desktop (please complete the following information):

rtakehara commented 4 years ago

I wasn't able to reproduce the problem, I did all the steps and the imported creatures (tried both jackal/Jackalwere and gnoll/gnoll pack lord).

Can you find the missing creature any other way? For example the search tool or compendium frame?

git-steve-git commented 4 years ago

OK, I went back and tried again. I can see all monsters in teh bestiary after import. I can find them with search. I took another look at the NPC drop down and realized I CAN see them there, as well, it's just that they aren't sorted alphabetically!

The new monsters like jackalwere and special gnolls are indeed in the drop down, but they appear further down below, not alphabetically in "the Js' (or the Gs.) Seems like there are a lot of monsters down below in a "second alphabet." Maybe its sorting by SRD vs non? Or "things that were there at first" followed by "new things imported"?

At any rate, a much less problematic issue than I first described. It would still be nice if they were all sorted alphabetically, but not a huge deal

rtakehara commented 4 years ago

oh, I see, that makes sense! Yeah these are one of the earliest codes and I didn't care too much about presentation, I was more worried with the game breaking bugs, but by now things are pretty stable and I will give this part a second look.

Edit: yeah, it wasn't even sorting in any way, it looked sorted by coincidence I think... It's sorted alphabetically now in v2.5

git-steve-git commented 4 years ago

Verified fixed on my end! Thank you so much!