Explorar el Código

Let Arbitrary calculate its absolute index

Ole hace 9 años
padre
commit
5e0aa99ee8
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      lib/luwra/types.hpp

+ 4 - 0
lib/luwra/types.hpp

@@ -256,6 +256,10 @@ struct Arbitrary {
 	 * Stack index
 	 */
 	int index;
+
+	Arbitrary(State* state, int index):
+		state(state), index(index < 0 ? lua_gettop(state) + (index + 1) : index)
+	{}
 };
 
 /**