From b2634bade04186233295894ed47c9698cc708391 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Sun, 9 Jul 2017 21:54:56 +0100 Subject: cItemGrid bounds check (#3837) --- src/ItemGrid.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ItemGrid.h') diff --git a/src/ItemGrid.h b/src/ItemGrid.h index a346c9c8d..e744afd87 100644 --- a/src/ItemGrid.h +++ b/src/ItemGrid.h @@ -162,6 +162,12 @@ public: // tolua_end + /** Returns true if slot coordinates lie within the grid. */ + bool IsValidSlotCoords(int a_X, int a_Y) const; + + /** Returns true if slot number is within the grid. */ + bool IsValidSlotNum(int a_SlotNum) const; + /** Generates random loot from the specified loot probability table, with a chance of enchanted books added. A total of a_NumSlots are taken by the loot. Cannot export to Lua due to raw array a_LootProbabs. TODO: Make this exportable / export through ManualBindings.cpp with a Lua table as LootProbabs -- cgit v1.2.3