Zamirathe / ZaupFeast

Feast Rocket Plugin for Unturned 3.0
Other
0 stars 10 forks source link

Items drops in wrong places. #3

Closed Nicholaiii closed 9 years ago

Nicholaiii commented 9 years ago

Whenever there is a feast, the item's dropped will not be selected by location. The plugin selects a random location in the list, and then drops the configured number items, selected randomly from the whole list, not considering locations specified by that specific item.

Here is my full config: http://pastebin.com/BXMZfcfw

Nicholaiii commented 9 years ago

I wanted to test if the config was loaded correctly into the plugin so I ran this code

foreach (FeastItem item in Feast.instance.items)
            {
                Logger.Log("> Item: " + item.Name);
                Logger.Log("> Locations:");
                foreach (string location in item.Location)
                {
                    Logger.Log(">> " + location);  
                }
                System.Threading.Thread.Sleep(250);
            }

And it output everything as expected.

I then took a look at the code where it adds the items and found the culprit: if (current.Location.Contains(feast.nextLocation.Name()) || !current.Location.Contains("all") || !current.Location.Contains("All"))

Zamirathe commented 9 years ago

This will be fixed in the new version.