I am not able to provide a short working example, but due to its nature, I can explain it with a couple of lines:
Code: Select all
ForEach(Actions.Availablemoves, Function(MapDataLocation, notused)
MapDataLocation = ToNumber(MapDataLocation)
DebugPrint("MapdataLocation: "..MapDataLocation)
self.Map_MouseOverFuncs[MapDataLocation] = Function() self:Draw_Path(Actions.Availablemoves[MapDataLocation].path) EndFunction
However, it does have. The strange thing here is that If I use variable "MapDataLocation", even that MapDataLocation in debugprint shows 162, it doesnt work.
But If I directly either write self:Draw_Path(Actions.Availablemoves[162].path, or if I manually set "MapDataLocation = 162" it works just fine.
But if I get it as Index, even using ToNumber() wont help. It simply keeps complaining that "path" doesnt exist.
To add more to this is that other MapDataLocation numbers work just fine, and they are set in same ForEach function elsewhere in the program as is index 162, so I see no reason why this specific 162 index would fail, while the rest don't.