Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Item Drop Window Bug Report

A topic by Maindric created 36 days ago Views: 32 Replies: 1
Viewing posts 1 to 2
(1 edit)

BUG: The drop window does not scale with additional drops.

Image:

image.png

Settings:

image.png

You can see there should be at least 2 items dropped from this enemy.

image.png

Max Lines is set to 0, which is supposed to be automatic.

Commentary:

I will set to 3 for now to always show, but I will see if I can dig into the code to resolve.

(3 edits)

Ok, I figured out the issue.

image.png

In the plugin, it checks for the item ID, but it ignores if they are different types of items. As such, if the drop pool includes an Item of ID 1 and a Weapon of ID 1, then one will overwrite the other when populating the rewardList array.

Not sure if this is the best solution, but I fixed it by replacing line 979 code:

            for(const item of BattleManager._rewards.items){

                if(item.id in rewardList && item === rewardList[item.id].obj){
                    rewardList[item.id].amount++
                }else{
                    rewardList[item.id] = {amount: 1, obj: item}
                }
            }

With:

            for(const item of BattleManager._rewards.items){
                var type = -1;
                if(item.hasOwnProperty("itypeId")) {
                    type = "i";
                } else {
                    type = item.etypeId.toString();
                }
                const key = type + item.id.toString();
                if(key in rewardList && item === rewardList[key].obj){
                    rewardList[key].amount++
                }else{
                    rewardList[key] = {amount: 1, obj: item}
                }
            }

This creates a unique key for all types of equipment and items along with the ID. May not be the most performant, but allows the drop table to show all drops, regardless of dropped IDs. Even still allows quantities.

EDIT: On further inspection, this change might allow the removal of && item === rewardList[key].obj as the key should be unique 100% of the time.