Initialize TileAnimationParams to prevent crashes/bugs for legacy invocations of add_particle{,spawner} (fixes #5108)

This commit is contained in:
sfan5 2017-01-24 15:19:29 +01:00
parent 59fdf57134
commit 0cde270bf5

@ -51,6 +51,7 @@ int ModApiParticles::l_add_particle(lua_State *L)
bool collisiondetection, vertical, collision_removal; bool collisiondetection, vertical, collision_removal;
collisiondetection = vertical = collision_removal = false; collisiondetection = vertical = collision_removal = false;
struct TileAnimationParams animation; struct TileAnimationParams animation;
animation.type = TAT_NONE;
std::string texture = ""; std::string texture = "";
std::string playername = ""; std::string playername = "";
@ -155,6 +156,7 @@ int ModApiParticles::l_add_particlespawner(lua_State *L)
bool collisiondetection, vertical, collision_removal; bool collisiondetection, vertical, collision_removal;
collisiondetection = vertical = collision_removal = false; collisiondetection = vertical = collision_removal = false;
struct TileAnimationParams animation; struct TileAnimationParams animation;
animation.type = TAT_NONE;
ServerActiveObject *attached = NULL; ServerActiveObject *attached = NULL;
std::string texture = ""; std::string texture = "";
std::string playername = ""; std::string playername = "";