1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Prevent attached models from disappearing during parent reload (#4128)

This commit is contained in:
Foghrye4 2016-10-08 16:51:25 +04:00 committed by Ner'zhul
parent 9978d0796f
commit ad163ee5c3
7 changed files with 62 additions and 32 deletions

View file

@ -137,8 +137,8 @@ int ObjectRef::l_remove(lua_State *L)
if (co->getType() == ACTIVEOBJECT_TYPE_PLAYER)
return 0;
std::set<int> child_ids = co->getAttachmentChildIds();
std::set<int>::iterator it;
UNORDERED_SET<int> child_ids = co->getAttachmentChildIds();
UNORDERED_SET<int>::iterator it;
for (it = child_ids.begin(); it != child_ids.end(); ++it) {
ServerActiveObject *child = env->getActiveObject(*it);
child->setAttachment(0, "", v3f(0, 0, 0), v3f(0, 0, 0));