mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Create framework for getting rid of global definitions of node/tool/item/whatever types
This commit is contained in:
parent
5fc791ac9a
commit
abceeee92f
60 changed files with 1017 additions and 743 deletions
|
@ -478,7 +478,11 @@ private:
|
|||
<<" itemstring=\""<<itemstring<<"\""<<std::endl;
|
||||
// Do it
|
||||
std::istringstream is(itemstring, std::ios::binary);
|
||||
InventoryItem *item = InventoryItem::deSerialize(is);
|
||||
ServerEnvironment *env = co->getEnv();
|
||||
assert(env);
|
||||
IGameDef *gamedef = env->getGameDef();
|
||||
InventoryItem *item = InventoryItem::deSerialize(is, gamedef);
|
||||
infostream<<"item="<<env<<std::endl;
|
||||
bool fits = co->addToInventory(item);
|
||||
// Return
|
||||
lua_pushboolean(L, fits);
|
||||
|
@ -557,7 +561,8 @@ const luaL_reg ObjectRef::methods[] = {
|
|||
};
|
||||
|
||||
// Creates a new anonymous reference if id=0
|
||||
static void objectref_get_or_create(lua_State *L, ServerActiveObject *cobj)
|
||||
static void objectref_get_or_create(lua_State *L,
|
||||
ServerActiveObject *cobj)
|
||||
{
|
||||
if(cobj->getId() == 0){
|
||||
ObjectRef::create(L, cobj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue