{"action":"created","issue":{"url":"https://api.github.com/repos/peq/wurstStdlib/issues/14","repository_url":"https://api.github.com/repos/peq/wurstStdlib","labels_url":"https://api.github.com/repos/peq/wurstStdlib/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/peq/wurstStdlib/issues/14/comments","events_url":"https://api.github.com/repos/peq/wurstStdlib/issues/14/events","html_url":"https://github.com/peq/wurstStdlib/issues/14","id":170930838,"number":14,"title":"Unit Indexer omits pre-enter indexing","user":{"login":"BlueSaint","id":20930833,"avatar_url":"https://avatars.githubusercontent.com/u/20930833?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueSaint","html_url":"https://github.com/BlueSaint","followers_url":"https://api.github.com/users/BlueSaint/followers","following_url":"https://api.github.com/users/BlueSaint/following{/other_user}","gists_url":"https://api.github.com/users/BlueSaint/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueSaint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueSaint/subscriptions","organizations_url":"https://api.github.com/users/BlueSaint/orgs","repos_url":"https://api.github.com/users/BlueSaint/repos","events_url":"https://api.github.com/users/BlueSaint/events{/privacy}","received_events_url":"https://api.github.com/users/BlueSaint/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-12T18:28:15Z","updated_at":"2016-08-14T16:28:45Z","closed_at":null,"body":"```\r\nimport UnitIndexer\r\nimport ClosureTimers\r\n\r\ninit\r\n\tlet u\t= createUnit(Player(0),'hfoo',vec2(0,0),angle(0))\r\n\tprint(u.toUnitIndex() castTo int.toString())\r\n\tdoAfter(0,() -> print(u.getIndex().toString())) // <-- prints different index\r\n```\r\nI don't know how to create pull requests, but you just change line 38 in UnitIndexer to:\r\n`onEnter(() -> getEnterLeaveUnit().toUnitIndex())`"},"comment":{"url":"https://api.github.com/repos/peq/wurstStdlib/issues/comments/239682670","html_url":"https://github.com/peq/wurstStdlib/issues/14#issuecomment-239682670","issue_url":"https://api.github.com/repos/peq/wurstStdlib/issues/14","id":239682670,"user":{"login":"peq","id":1071762,"avatar_url":"https://avatars.githubusercontent.com/u/1071762?v=3","gravatar_id":"","url":"https://api.github.com/users/peq","html_url":"https://github.com/peq","followers_url":"https://api.github.com/users/peq/followers","following_url":"https://api.github.com/users/peq/following{/other_user}","gists_url":"https://api.github.com/users/peq/gists{/gist_id}","starred_url":"https://api.github.com/users/peq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peq/subscriptions","organizations_url":"https://api.github.com/users/peq/orgs","repos_url":"https://api.github.com/users/peq/repos","events_url":"https://api.github.com/users/peq/events{/privacy}","received_events_url":"https://api.github.com/users/peq/received_events","type":"User","site_admin":false},"created_at":"2016-08-14T16:28:45Z","updated_at":"2016-08-14T16:28:45Z","body":"Ok, I got the problem now:\r\n\r\nI suggest the following changes:\r\n\r\nin UnitIndexer: change as you suggested, I was wrong here: `onEnter(() -> getEnterLeaveUnit().toUnitIndex())` (use cache instead of assigning a new index)\r\n\r\nin OnUnitEnterLeave: Keep a group of registered units. When onEnter is called, execute the callback with all units in that group.\r\n\r\n\r\n"}}
{"actor":{"display_login":"peq"}}