aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_content.cpp8
-rw-r--r--src/script/lua_api/l_mainmenu.cpp6
-rw-r--r--src/script/lua_api/l_mapgen.cpp3
-rw-r--r--src/script/lua_api/l_object.cpp3
4 files changed, 8 insertions, 12 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 033549475..7e2f6772f 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -348,7 +348,7 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
u16 i = 1;
for (const std::string &texture : prop->textures) {
lua_pushlstring(L, texture.c_str(), texture.size());
- lua_rawseti(L, -2, i);
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "textures");
@@ -356,7 +356,7 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
i = 1;
for (const video::SColor &color : prop->colors) {
push_ARGB8(L, color);
- lua_rawseti(L, -2, i);
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "colors");
@@ -838,7 +838,7 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
u16 i = 1;
for (const std::string &it : c.connects_to) {
lua_pushlstring(L, it.c_str(), it.size());
- lua_rawseti(L, -2, i);
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "connects_to");
@@ -961,7 +961,7 @@ void push_box(lua_State *L, const std::vector<aabb3f> &box)
u8 i = 1;
for (const aabb3f &it : box) {
push_aabb3f(L, it);
- lua_rawseti(L, -2, i);
+ lua_rawseti(L, -2, i++);
}
}
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index f0f56098f..145ff0970 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -532,8 +532,7 @@ int ModApiMainMenu::l_get_content_info(lua_State *L)
int i = 1;
for (const auto &dep : spec.depends) {
lua_pushstring(L, dep.c_str());
- lua_rawseti(L, -2, i);
- i++;
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "depends");
@@ -542,8 +541,7 @@ int ModApiMainMenu::l_get_content_info(lua_State *L)
i = 1;
for (const auto &dep : spec.optdepends) {
lua_pushstring(L, dep.c_str());
- lua_rawseti(L, -2, i);
- i++;
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "optional_depends");
}
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index b8e52bd49..92ed4377e 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -1042,8 +1042,7 @@ int ModApiMapgen::l_get_gen_notify(lua_State *L)
int i = 1;
for (u32 gen_notify_on_deco_id : emerge->gen_notify_on_deco_ids) {
lua_pushnumber(L, gen_notify_on_deco_id);
- lua_rawseti(L, -2, i);
- i++;
+ lua_rawseti(L, -2, i++);
}
return 2;
}
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index f077d42a0..e673778e9 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -1681,8 +1681,7 @@ int ObjectRef::l_get_sky(lua_State *L)
s16 i = 1;
for (const std::string &param : params) {
lua_pushlstring(L, param.c_str(), param.size());
- lua_rawseti(L, -2, i);
- i++;
+ lua_rawseti(L, -2, i++);
}
lua_pushboolean(L, clouds);
return 4;