Removed unused function lua_unit::reload.

This commit is contained in:
Guillaume Melquiond 2010-07-25 15:34:00 +00:00
parent 9b9c6e548b
commit 4ab0dcb758
2 changed files with 6 additions and 11 deletions

View file

@ -432,14 +432,6 @@ unit *lua_unit::get()
return &*ui;
}
void lua_unit::reload()
{
assert(ptr);
uid = ptr->underlying_id();
delete ptr;
ptr= NULL;
}
/**
* Converts a Lua value to a unit pointer.
*/
@ -1833,8 +1825,12 @@ static int intf_put_unit(lua_State *L)
resources::units->erase(loc);
if (u) {
resources::units->add(loc, *u);
if (!lu) delete u;
else lu->reload();
if (lu) {
size_t uid = u->underlying_id();
lu->lua_unit::~lua_unit();
new(lu) lua_unit(uid);
} else
delete u;
}
return 0;

View file

@ -49,7 +49,6 @@ public:
~lua_unit();
bool on_map() const { return !ptr && side == 0; }
int on_recall_list() const { return side; }
void reload();
unit *get();
};