diff src/modules/graphics/opengl/wrap_ParticleSystem.cpp @ 1192:bf8e12d0015f

Enfore limits on ParticleSystem:setSizeVariation (issue #545)
author Bart van Strien <bart.bes+projects@gmail.com>
date Fri, 18 Jan 2013 21:03:07 +0100
parents 13e6ca38c28c
children 7140379315ee b7f097053d74
line wrap: on
line diff
--- a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp	Fri Jan 18 13:20:40 2013 +0100
+++ b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp	Fri Jan 18 21:03:07 2013 +0100
@@ -192,6 +192,9 @@
 {
 	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;
 }