Merge branch custom-entity-crash-fix.
--- a/Aquaria/Game.cpp Sun Apr 03 02:49:18 2011 +0900
+++ b/Aquaria/Game.cpp Sun Apr 03 03:05:13 2011 +0900
@@ -2718,7 +2718,7 @@
if (createSaveData)
{
int idx = dsq->game->getIdxForEntityType(type);
- entitySaveData.push_back(EntitySaveData(e, idx, usePos.x, usePos.y, rot, e->getGroupID(), e->getID()));
+ entitySaveData.push_back(EntitySaveData(e, idx, usePos.x, usePos.y, rot, e->getGroupID(), e->getID(), e->name));
}
addRenderObject(e, e->layer);
@@ -5645,8 +5645,8 @@
if (e->idx == -1)
{
- if (!e->e->name.empty())
- os << e->e->name << " ";
+ if (!e->name.empty())
+ os << e->name << " ";
else
os << "INVALID" << " ";
}
--- a/Aquaria/Game.h Sun Apr 03 02:49:18 2011 +0900
+++ b/Aquaria/Game.h Sun Apr 03 03:05:13 2011 +0900
@@ -606,9 +606,10 @@
struct EntitySaveData
{
public:
- EntitySaveData(Entity *e, int idx, int x, int y, int rot, int group, int id) : e(e), idx(idx), x(x), y(y), rot(rot), group(group), id(id) {}
+ EntitySaveData(Entity *e, int idx, int x, int y, int rot, int group, int id, const std::string &name) : e(e), idx(idx), x(x), y(y), rot(rot), group(group), id(id), name(name) {}
Entity *e;
int idx, x, y, rot, group, id;
+ std::string name;
};
class Game : public StateObject