mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Enfore limits on ParticleSystem:setSizeVariation (issue #545)
This commit is contained in:
@@ -192,6 +192,9 @@ int w_ParticleSystem_setSizeVariation(lua_State *L)
|
||||
{
|
||||
ParticleSystem *t = luax_checkparticlesystem(L, 1);
|
||||
float arg1 = (float)luaL_checknumber(L, 2);
|
||||
if (arg1 < 0.0f || arg1 > 1.0f)
|
||||
return luaL_error(L, "Size variation has to be between 0 and 1, inclusive.");
|
||||
|
||||
t->setSizeVariation(arg1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user