diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-05-11 14:07:30 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-05-11 14:07:30 +0200 |
commit | 4f613bbf5118ebe8c3610514e7f4206e930783bf (patch) | |
tree | bcb4bbb7609019f948e31b7749e1beb6b23e634d /src/client | |
parent | c86dcd0f682f76339989afec255bf3d7078db096 (diff) | |
download | dragonfireclient-4f613bbf5118ebe8c3610514e7f4206e930783bf.tar.xz |
Include tile definitions in get_node_def; Client-side minetest.object_refs table
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/clientenvironment.cpp | 11 | ||||
-rw-r--r-- | src/client/game.cpp | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/client/clientenvironment.cpp b/src/client/clientenvironment.cpp index fd56c8f44..8e0d00bc9 100644 --- a/src/client/clientenvironment.cpp +++ b/src/client/clientenvironment.cpp @@ -352,6 +352,7 @@ void ClientEnvironment::addActiveObject(u16 id, u8 type, { ClientActiveObject* obj = ClientActiveObject::create((ActiveObjectType) type, m_client, this); + if(obj == NULL) { infostream<<"ClientEnvironment::addActiveObject(): " @@ -362,6 +363,9 @@ void ClientEnvironment::addActiveObject(u16 id, u8 type, obj->setId(id); + if (m_client->modsLoaded()) + m_client->getScript()->addObjectReference(dynamic_cast<ActiveObject*>(obj)); + try { obj->initialize(init_data); @@ -394,9 +398,14 @@ void ClientEnvironment::removeActiveObject(u16 id) { // Get current attachment childs to detach them visually std::unordered_set<int> attachment_childs; - if (auto *obj = getActiveObject(id)) + auto *obj = getActiveObject(id); + if (obj) { attachment_childs = obj->getAttachmentChildIds(); + if (m_client->modsLoaded()) + m_client->getScript()->removeObjectReference(dynamic_cast<ActiveObject*>(obj)); + } + m_ao_manager.removeObject(id); // Perform a proper detach in Irrlicht diff --git a/src/client/game.cpp b/src/client/game.cpp index 104a6e374..e1f2fbe75 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -734,7 +734,7 @@ bool Game::connectToServer(const GameStartData &start_data, } else { wait_time += dtime; // Only time out if we aren't waiting for the server we started - if (!start_data.isSinglePlayer() && wait_time > 10) { + if (!start_data.local_server && !start_data.isSinglePlayer() && wait_time > 10) { *error_message = "Connection timed out."; errorstream << *error_message << std::endl; break; |