tile max things

This commit is contained in:
Henrique Santiago 2012-05-10 09:09:44 -03:00
parent 16f991e2ed
commit a20a56a66c
2 changed files with 7 additions and 0 deletions

View File

@ -181,6 +181,9 @@ ThingPtr Tile::addThing(const ThingPtr& thing, int stackPos)
oldObject = m_things[stackPos]; oldObject = m_things[stackPos];
m_things.insert(m_things.begin() + stackPos, thing); m_things.insert(m_things.begin() + stackPos, thing);
if(m_things.size() > MAX_THINGS)
removeThing(m_things[MAX_THINGS]);
return oldObject; return oldObject;
} }

View File

@ -29,6 +29,10 @@
class Tile : public LuaObject class Tile : public LuaObject
{ {
public: public:
enum {
MAX_THINGS = 10
};
Tile(const Position& position); Tile(const Position& position);
void draw(const Point& dest, float scaleFactor, int drawFlags); void draw(const Point& dest, float scaleFactor, int drawFlags);