diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2018-05-14 07:42:20 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2018-06-03 17:32:00 +0200 |
commit | 695d02e6bda939f7b00af402273b39a8fd75a203 (patch) | |
tree | 30e075240af7397fd933852e20f812417bb93b45 /src/script | |
parent | e2815d27f16f20c503c34b9a0ab4f917dcab639b (diff) | |
download | minetest-695d02e6bda939f7b00af402273b39a8fd75a203.tar.gz minetest-695d02e6bda939f7b00af402273b39a8fd75a203.tar.bz2 minetest-695d02e6bda939f7b00af402273b39a8fd75a203.zip |
More C++03 fixes
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/cpp_api/s_item.h | 2 | ||||
-rw-r--r-- | src/script/lua_api/l_env.cpp | 4 | ||||
-rw-r--r-- | src/script/lua_api/l_object.cpp | 8 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/script/cpp_api/s_item.h b/src/script/cpp_api/s_item.h index b4b02b0c5..daff15bf1 100644 --- a/src/script/cpp_api/s_item.h +++ b/src/script/cpp_api/s_item.h @@ -53,7 +53,7 @@ protected: friend class LuaItemStack; friend class ModApiItemMod; - bool getItemCallback(const char *name, const char *callbackname, const v3s16 *p = nullptr); + bool getItemCallback(const char *name, const char *callbackname, const v3s16 *p = NULL); void pushPointedThing(const PointedThing& pointed); }; diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 4a7885da7..630f6cc64 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -292,7 +292,7 @@ int ModApiEnvMod::l_place_node(lua_State *L) pointed.node_abovesurface = pos; pointed.node_undersurface = pos + v3s16(0,-1,0); // Place it with a NULL placer (appears in Lua as nil) - bool success = scriptIfaceItem->item_OnPlace(item, nullptr, pointed); + bool success = scriptIfaceItem->item_OnPlace(item, NULL, pointed); lua_pushboolean(L, success); return 1; } @@ -676,7 +676,7 @@ int ModApiEnvMod::l_find_nodes_in_area(lua_State *L) ndef->getIds(lua_tostring(L, 3), filter); } - std::unordered_map<content_t, u32> individual_count; + UNORDERED_MAP<content_t, u32> individual_count; lua_newtable(L); u64 i = 0; diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 0195dc399..8905f2d0c 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_item.h" #include "common/c_converter.h" #include "common/c_content.h" +#include "util/cpp11_container.h" #include "log.h" #include "tool.h" #include "serverobject.h" @@ -137,10 +138,11 @@ int ObjectRef::l_remove(lua_State *L) if (co->getType() == ACTIVEOBJECT_TYPE_PLAYER) return 0; - const std::unordered_set<int> &child_ids = co->getAttachmentChildIds(); - for (int child_id : child_ids) { + const UNORDERED_SET<int> &child_ids = co->getAttachmentChildIds(); + for (UNORDERED_SET<int>::const_iterator it = child_ids.begin(); it != child_ids.end(); + ++it) { // Child can be NULL if it was deleted earlier - if (ServerActiveObject *child = env->getActiveObject(child_id)) + if (ServerActiveObject *child = env->getActiveObject(*it)) child->setAttachment(0, "", v3f(0, 0, 0), v3f(0, 0, 0)); } |