aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_particles.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com>2020-11-04 16:44:42 +0100
committerGitHub <noreply@github.com>2020-11-04 16:44:42 +0100
commit5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (patch)
treec980d614fec4a5495798be3e79e033229062c3cd /src/script/lua_api/l_particles.cpp
parent28f6a79706b088c37268a59d90878220dc4ef9c7 (diff)
parent3af10766fd2b58b068e970266724d7eb10e9316b (diff)
downloaddragonfireclient-5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc.tar.xz
Merge branch 'master' into master
Diffstat (limited to 'src/script/lua_api/l_particles.cpp')
-rw-r--r--src/script/lua_api/l_particles.cpp47
1 files changed, 21 insertions, 26 deletions
diff --git a/src/script/lua_api/l_particles.cpp b/src/script/lua_api/l_particles.cpp
index a51c4fe20..ea0a7c796 100644
--- a/src/script/lua_api/l_particles.cpp
+++ b/src/script/lua_api/l_particles.cpp
@@ -49,7 +49,7 @@ int ModApiParticles::l_add_particle(lua_State *L)
if (lua_gettop(L) > 1) // deprecated
{
log_deprecated(L, "Deprecated add_particle call with "
- "individual parameters instead of definition");
+ "individual parameters instead of definition");
p.pos = check_v3f(L, 1);
p.vel = check_v3f(L, 2);
p.acc = check_v3f(L, 3);
@@ -59,9 +59,7 @@ int ModApiParticles::l_add_particle(lua_State *L)
p.texture = luaL_checkstring(L, 7);
if (lua_gettop(L) == 8) // only spawn for a single player
playername = luaL_checkstring(L, 8);
- }
- else if (lua_istable(L, 1))
- {
+ } else if (lua_istable(L, 1)) {
lua_getfield(L, 1, "pos");
if (lua_istable(L, -1))
p.pos = check_v3f(L, -1);
@@ -71,7 +69,7 @@ int ModApiParticles::l_add_particle(lua_State *L)
if (lua_istable(L, -1)) {
p.vel = check_v3f(L, -1);
log_deprecated(L, "The use of vel is deprecated. "
- "Use velocity instead");
+ "Use velocity instead");
}
lua_pop(L, 1);
@@ -84,7 +82,7 @@ int ModApiParticles::l_add_particle(lua_State *L)
if (lua_istable(L, -1)) {
p.acc = check_v3f(L, -1);
log_deprecated(L, "The use of acc is deprecated. "
- "Use acceleration instead");
+ "Use acceleration instead");
}
lua_pop(L, 1);
@@ -93,15 +91,15 @@ int ModApiParticles::l_add_particle(lua_State *L)
p.acc = check_v3f(L, -1);
lua_pop(L, 1);
- p.expirationtime = getfloatfield_default(L, 1, "expirationtime",
- p.expirationtime);
+ p.expirationtime = getfloatfield_default(
+ L, 1, "expirationtime", p.expirationtime);
p.size = getfloatfield_default(L, 1, "size", p.size);
- p.collisiondetection = getboolfield_default(L, 1,
- "collisiondetection", p.collisiondetection);
- p.collision_removal = getboolfield_default(L, 1,
- "collision_removal", p.collision_removal);
- p.object_collision = getboolfield_default(L, 1,
- "object_collision", p.object_collision);
+ p.collisiondetection = getboolfield_default(
+ L, 1, "collisiondetection", p.collisiondetection);
+ p.collision_removal = getboolfield_default(
+ L, 1, "collision_removal", p.collision_removal);
+ p.object_collision = getboolfield_default(
+ L, 1, "object_collision", p.object_collision);
p.vertical = getboolfield_default(L, 1, "vertical", p.vertical);
lua_getfield(L, 1, "animation");
@@ -156,10 +154,10 @@ int ModApiParticles::l_add_particlespawner(lua_State *L)
ServerActiveObject *attached = NULL;
std::string playername;
- if (lua_gettop(L) > 1) //deprecated
+ if (lua_gettop(L) > 1) // deprecated
{
log_deprecated(L, "Deprecated add_particlespawner call with "
- "individual parameters instead of definition");
+ "individual parameters instead of definition");
p.amount = luaL_checknumber(L, 1);
p.time = luaL_checknumber(L, 2);
p.minpos = check_v3f(L, 3);
@@ -176,9 +174,7 @@ int ModApiParticles::l_add_particlespawner(lua_State *L)
p.texture = luaL_checkstring(L, 14);
if (lua_gettop(L) == 15) // only spawn for a single player
playername = luaL_checkstring(L, 15);
- }
- else if (lua_istable(L, 1))
- {
+ } else if (lua_istable(L, 1)) {
p.amount = getintfield_default(L, 1, "amount", p.amount);
p.time = getfloatfield_default(L, 1, "time", p.time);
@@ -216,12 +212,12 @@ int ModApiParticles::l_add_particlespawner(lua_State *L)
p.maxexptime = getfloatfield_default(L, 1, "maxexptime", p.maxexptime);
p.minsize = getfloatfield_default(L, 1, "minsize", p.minsize);
p.maxsize = getfloatfield_default(L, 1, "maxsize", p.maxsize);
- p.collisiondetection = getboolfield_default(L, 1,
- "collisiondetection", p.collisiondetection);
- p.collision_removal = getboolfield_default(L, 1,
- "collision_removal", p.collision_removal);
- p.object_collision = getboolfield_default(L, 1,
- "object_collision", p.object_collision);
+ p.collisiondetection = getboolfield_default(
+ L, 1, "collisiondetection", p.collisiondetection);
+ p.collision_removal = getboolfield_default(
+ L, 1, "collision_removal", p.collision_removal);
+ p.object_collision = getboolfield_default(
+ L, 1, "object_collision", p.object_collision);
lua_getfield(L, 1, "animation");
p.animation = read_animation_definition(L, -1);
@@ -276,4 +272,3 @@ void ModApiParticles::Initialize(lua_State *L, int top)
API_FCT(add_particlespawner);
API_FCT(delete_particlespawner);
}
-