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

The doc and the actual behaviour differed.
master
TeTpaAka 2015-06-22 23:21:14 +02:00 committed by est31
parent 162af5fe32
commit dd2e08e117
1 changed files with 34 additions and 23 deletions

View File

@ -35,10 +35,13 @@ int ModApiParticles::l_add_particle(lua_State *L)
// Get parameters
v3f pos, vel, acc;
pos = vel = acc = v3f(0, 0, 0);
float expirationtime, size;
expirationtime = size = 1;
bool collisiondetection, vertical;
collisiondetection = vertical = false;
std::string texture = "";
const char *playername = "";
@ -66,8 +69,16 @@ int ModApiParticles::l_add_particle(lua_State *L)
pos = check_v3f(L, -1);
} else if (strcmp(key,"vel") == 0) {
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) {
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) {
expirationtime = luaL_checknumber(L, -1);
} else if (strcmp(key,"size") == 0) {