mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-12 16:58:39 +00:00
random scripting work-in-progress
This commit is contained in:
parent
f8430723e0
commit
a6a1e6ed1a
7 changed files with 55 additions and 24 deletions
|
@ -1576,9 +1576,22 @@ std::string LuaEntitySAO::getStaticData()
|
|||
// name
|
||||
os<<serializeString(m_init_name);
|
||||
// state
|
||||
std::string state = scriptapi_luaentity_get_state(L, m_id);
|
||||
os<<serializeString(state);
|
||||
if(m_registered){
|
||||
lua_State *L = m_env->getLua();
|
||||
scriptapi_luaentity_deregister(L, m_id);
|
||||
std::string state = scriptapi_luaentity_get_state(L, m_id);
|
||||
os<<serializeLongString(state);
|
||||
} else {
|
||||
os<<serializeLongString(m_init_state);
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
InventoryItem* LuaEntitySAO::createPickedUpItem()
|
||||
{
|
||||
std::istringstream is("CraftItem testobject1 1", std::ios_base::binary);
|
||||
InventoryItem *item = InventoryItem::deSerialize(is);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue