mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00: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:
parent
162af5fe32
commit
dd2e08e117
1 changed files with 34 additions and 23 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue