tile max things
This commit is contained in:
parent
16f991e2ed
commit
a20a56a66c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue