[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: problem with swig code
- From: Roger Durañona Vargas <luo_hei@...>
- Date: Sat, 23 Jan 2010 09:57:19 +0000
I have a weird error in code generated by swig. Here is the .i file:
%module GameEntity
%include <std_string.i>
%include <../include/GameEntity.h>
%{
#include "GameEntity.h"
%}
This is the class:
class BaseStats {
public:
int stats[stLUCK];
//int &operator[] ( int index) {return stats[index];};
int __getitem__(int i) const ; // i is the index, returns the data
void __setitem__(int i,int d) {stats[i]=d;}; // i is the index,
d is the data
};
So, from lua scripts I can do:
entity.stats[GameEntity.stSTR]=19;
Until a few days this was working fine, but now Im getting an error:
Error in __setitem__ (arg 2), expected 'int' got 'nil'
i really have no idea about what did I change to produce this. As I
said, this worked perfectly, until last week, and I didnt touched the
related code, so I guess I have a problem in some place, but I have no
idea about where to search. Can somebody suggest me something?
--
Roger D. Vargas
Gentoo Linux 2008.0
Using Gentoo Linux 2008.0, Ogre 1.6.2, fglrx
Powered by Core 2 E4500 2.2GHz, 2Gb RAM, Radeon HD4770
http://gpnfn.blogspot.com, The news for game programming newbies
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com