Skip to content

Commit

Permalink
Initialize TileAnimationParams to prevent crashes/bugs for legacy inv…
Browse files Browse the repository at this point in the history
…ocations of add_particle{,spawner} (fixes #5108)
  • Loading branch information
sfan5 committed Jan 24, 2017
1 parent 59fdf57 commit 0cde270
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/script/lua_api/l_particles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ int ModApiParticles::l_add_particle(lua_State *L)
bool collisiondetection, vertical, collision_removal;
collisiondetection = vertical = collision_removal = false;
struct TileAnimationParams animation;
animation.type = TAT_NONE;

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

0 comments on commit 0cde270

Please sign in to comment.