mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Sanitize invalid particle spawner time (#15465)
This commit is contained in:
parent
11b19cd126
commit
b77ad82fb9
3 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
#include "lua_api/l_particles.h"
|
||||
#include "common/c_types.h"
|
||||
#include "lua_api/l_object.h"
|
||||
#include "lua_api/l_internal.h"
|
||||
#include "lua_api/l_particleparams.h"
|
||||
|
@ -280,6 +281,9 @@ int ModApiParticles::l_add_particlespawner(lua_State *L)
|
|||
p.node_tile = getintfield_default(L, 1, "node_tile", p.node_tile);
|
||||
}
|
||||
|
||||
if (p.time < 0)
|
||||
throw LuaError("particle spawner 'time' must be >= 0");
|
||||
|
||||
u32 id = getServer(L)->addParticleSpawner(p, attached, playername);
|
||||
lua_pushnumber(L, id);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue