I cannot return a float variable from my plugin functions!!!
managed struct MyStruct {
import static MyStruct* Create(...);
import int aaa(...);
import float bbb(...);
}
when I call, from the script, the function aaa(...) it's all OK but when I call the function bbb(...) the return value is always 0 or NULL.
any suggestion???
Maybe they're actually doubles?
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23020.msg283340#msg283340
OK!! thank you very much!!!
the soulution is:
#define FLOAT_RETURN_TYPE long
#define RETURN_FLOAT(x) return *((long*)&x)
FLOAT_RETURN_TYPE bbb (...) {
float fval;
.....
.....
RETURN_FLOAT(fval);
}