(svn r13474) [NoAI] -Fix: remove the restriction of 10 params per Valuator noai
authortruebrain
Wed, 11 Jun 2008 15:35:21 +0000
branchnoai
changeset 10921 f50864092014
parent 10920 e33442a2b239
child 10930 8e2c924c7077
(svn r13474) [NoAI] -Fix: remove the restriction of 10 params per Valuator
src/ai/api/ai_abstractlist.cpp
--- a/src/ai/api/ai_abstractlist.cpp	Wed Jun 11 15:23:32 2008 +0000
+++ b/src/ai/api/ai_abstractlist.cpp	Wed Jun 11 15:35:21 2008 +0000
@@ -5,6 +5,7 @@
 #include <squirrel.h>
 #include "ai_abstractlist.hpp"
 #include "../../debug.h"
+#include "../../core/alloc_func.hpp"
 
 /**
  * Base class for any AIAbstractList sorter.
@@ -547,8 +548,7 @@
 	sq_getstackobj(vm, 2, &obj_func);
 
 	/* Read the params */
-	HSQOBJECT obj_params[10];
-	assert(nparam < 10);
+	HSQOBJECT *obj_params = AllocaM(HSQOBJECT, nparam);
 	for (int i = 0; i < nparam; i++) {
 		sq_getstackobj(vm, i + 3, &obj_params[i]);
 	}