1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-17 23:05:07 -05:00

Make acc and vel deprecated in add_particle and search for acceleration and velocity instead

The doc and the actual behaviour differed.
This commit is contained in:
TeTpaAka 2015-06-22 23:21:14 +02:00 committed by est31
parent 162af5fe32
commit dd2e08e117

View File

@ -35,10 +35,13 @@ int ModApiParticles::l_add_particle(lua_State *L)
// Get parameters // Get parameters
v3f pos, vel, acc; v3f pos, vel, acc;
pos = vel = acc = v3f(0, 0, 0); pos = vel = acc = v3f(0, 0, 0);
float expirationtime, size; float expirationtime, size;
expirationtime = size = 1; expirationtime = size = 1;
bool collisiondetection, vertical; bool collisiondetection, vertical;
collisiondetection = vertical = false; collisiondetection = vertical = false;
std::string texture = ""; std::string texture = "";
const char *playername = ""; const char *playername = "";
@ -66,8 +69,16 @@ int ModApiParticles::l_add_particle(lua_State *L)
pos = check_v3f(L, -1); pos = check_v3f(L, -1);
} else if (strcmp(key,"vel") == 0) { } else if (strcmp(key,"vel") == 0) {
vel = check_v3f(L, -1); vel = check_v3f(L, -1);
log_deprecated(L, "The use of vel is deprecated. "
"Use velocity instead");
} else if (strcmp(key,"velocity") == 0) {
vel = check_v3f(L, -1);
} else if (strcmp(key,"acc") == 0) { } else if (strcmp(key,"acc") == 0) {
acc = check_v3f(L, -1); acc = check_v3f(L, -1);
log_deprecated(L, "The use of acc is deprecated. "
"Use acceleration instead");
} else if (strcmp(key,"acceleration") == 0) {
acc = check_v3f(L, -1);
} else if (strcmp(key,"expirationtime") == 0) { } else if (strcmp(key,"expirationtime") == 0) {
expirationtime = luaL_checknumber(L, -1); expirationtime = luaL_checknumber(L, -1);
} else if (strcmp(key,"size") == 0) { } else if (strcmp(key,"size") == 0) {