{"action":"opened","issue":{"url":"https://api.github.com/repos/SilverIce/JContainers/issues/40","labels_url":"https://api.github.com/repos/SilverIce/JContainers/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/SilverIce/JContainers/issues/40/comments","events_url":"https://api.github.com/repos/SilverIce/JContainers/issues/40/events","html_url":"https://github.com/SilverIce/JContainers/issues/40","id":55633173,"number":40,"title":"JC 3.2 lua find function issue","user":{"login":"RealAntithesis","id":8175503,"avatar_url":"https://avatars.githubusercontent.com/u/8175503?v=3","gravatar_id":"","url":"https://api.github.com/users/RealAntithesis","html_url":"https://github.com/RealAntithesis","followers_url":"https://api.github.com/users/RealAntithesis/followers","following_url":"https://api.github.com/users/RealAntithesis/following{/other_user}","gists_url":"https://api.github.com/users/RealAntithesis/gists{/gist_id}","starred_url":"https://api.github.com/users/RealAntithesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RealAntithesis/subscriptions","organizations_url":"https://api.github.com/users/RealAntithesis/orgs","repos_url":"https://api.github.com/users/RealAntithesis/repos","events_url":"https://api.github.com/users/RealAntithesis/events{/privacy}","received_events_url":"https://api.github.com/users/RealAntithesis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-27T15:38:23Z","updated_at":"2015-01-27T15:38:23Z","closed_at":null,"body":"Hi, I think there may be an issue with the jc.find function in JContainers 3.2. When adding the JC 3.2 files to AH Hotkeys, the lua find function started giving incorrect results (finding JMap fields in an array). Doing a test script indicated that the JC 3.2 function may be counting the first element of an array as 1 instead of zero.\r\n\r\ne.g. \r\n```lua\r\nfunction DoTest()\r\n\tint testMap1 = JMap.object()\r\n\tJMap.setInt(testMap1, \"itemSlot\", 42)\r\n\tint testMap2 = JMap.object()\r\n\tJMap.setInt(testMap2, \"itemSlot\", 33)\r\n\tint testMap3 = JMap.object()\r\n\tJMap.setInt(testMap3, \"itemSlot\", 56)\r\n\tint testArray = JArray.object()\r\n\tJArray.addObj(testArray, testMap1)\r\n\tJArray.addObj(testArray, testMap2)\r\n\tJArray.addObj(testArray, testMap3)\r\n\tint itemSlotToFind = 42 ; lookup this value in the evalLuaInt\r\n\tint actualIndex = 0 ; this is the actual array item (note: starts from 0)\r\n\tint foundIndex = JValue.evalLuaInt(testArray, \"return jc.find(jobject, function(x) return x.itemSlot == \" + itemSlotToFind + \" end)\")\r\n\tDebugMessage(\"DoTest(): evalLuaInt returned foundIndex of \" + foundIndex + \"; actualIndex is \" + actualIndex)\r\nendFunction\r\n```\r\nif itemSlotToFind is 42, evalLuaInt returns 1, not 0\r\nif itemSlotToFind is 33, evalLuaInt returns 2, not 1\r\nif itemSlotToFind is 56, evalLuaInt returns 3, not 2\r\n\r\nCould you have a look? I'm assuming that JArray indices should still start from zero? Thanks :)"}}