Zaicon / InfiniteChestsV2

5 stars 4 forks source link

/prunechests will remove (almost) all chest #4

Closed OnsenManju closed 7 years ago

OnsenManju commented 8 years ago

prunechests It will be caused due to this query: https://github.com/Zaicon/InfiniteChestsV2/blob/master/InfChests/DB.cs#L378 That reads "enumerate if one of its slots is empty".

Probably that should be, for example: string query = $"SELECT ChestID FROM ChestItems WHERE WorldID = {Main.worldID} GROUP BY ChestID HAVING MIN(Type) = 0 AND MAX(Type) = 0"; That means "show its id if all slot is empty for each chest".

And also, at line 403 is like this: query = $"DELETE FROM ChestItems WHERE WorldID = {Main.worldID} AND ChestID IN ({string.Join(",", chestIDs)})"; (Sorry I didn't confirm them actually)

I'm not sure whether this issue is related to that post though. https://tshock.co/xf/index.php?threads/infinitechestsv2.4795/page-2#post-47100

Kojirremer commented 7 years ago

As I stated on that post, it will always crash in my case, but I did see all (non-empty) chest in my screen being uprooted before getting the crash notification.

Zaicon commented 7 years ago

Fixed in https://github.com/Zaicon/InfiniteChestsV2/commit/71daf9a0ba2799ed004cafdca6aef0ba2fe02ee6.