Struct value either resets, or not getting passed correctly

solidstate1991 laszloszeremi at outlook.com
Sun Nov 19 23:02:58 UTC 2023


https://github.com/ZILtoid1991/pixelperfectengine/blob/ed93bec15deea042516615e73c57d137a2c1f762/pixelperfectengine/src/pixelperfectengine/scripting/lua.d#L98

Struct `LuaVar` seems to work for the most part, however, at 
certain point, the value seems to be reset to zero, or not being 
passed to the target function.

```d
staticMap!(Unqual,Parameters!Func) params;
int stackCounter = 0;
try {
	foreach_reverse(ref param; params) {
		stackCounter--;
		param = luaGetFromIndex!(typeof(param))(state, stackCounter);
	}
}
```

My theory is, that if `typeof(param)` is `LuaVar`, I'm missing 
some extra steps I'm not doing. Other types of data seem to get 
through, or at least according to me poking around with debuggers.


More information about the Digitalmars-d-learn mailing list