{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/136","labels_url":"https://api.github.com/repos/chrsmith/bwapi/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/bwapi/issues/136/comments","events_url":"https://api.github.com/repos/chrsmith/bwapi/issues/136/events","html_url":"https://github.com/chrsmith/bwapi/issues/136","id":58274841,"number":136,"title":"Game::getMinerals() returns opponents mineral fields","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/auto-migrated","name":"auto-migrated","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-19T21:44:40Z","updated_at":"2015-02-19T21:44:41Z","closed_at":null,"body":"```\nWhat steps will reproduce the problem?\n1. Ensure that complete map information is OFF\n2. Call Broodwar->getMinerals()\n\nWhat is the expected output? What do you see instead?\n\nI expect a set< Unit * > of all my visible minerals. \nInstead, I get a set of my opponents (invisible to me) minerals.\n\nWhat version of the product are you using? On what operating system?\n\nbwapi beta 2.3 / WinXP running under Parallels 4, on OS X 10.6\n\nPlease provide any additional information below.\n\nIf I use Broodwar->getAllUnits(), and filter for units with \nUnitTypes::Resource_Mineral_Field, then I get my own visible minerals, as \nexpected.\n```\n\n-----\nOriginal issue reported on code.google.com by `jaba.ad...@gmail.com` on 24 Nov 2009 at 4:21"},"comment":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/comments/75143370","html_url":"https://github.com/chrsmith/bwapi/issues/136#issuecomment-75143370","issue_url":"https://api.github.com/repos/chrsmith/bwapi/issues/136","id":75143370,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T21:44:41Z","updated_at":"2015-02-19T21:44:41Z","body":"```\nI met the same problem before and I thought that getMinerals returns all \nminerals on \nthe Map.\nJust now I take a look at the GameImpl.cpp and find that\n1. getMinerals() returns the minerals set in GameImpl\n2. updateUnit() is called in GameImpl::update() every frame. It clears the \nminerals \nset then inserts mineral unit to the set every frame if the mineral unit \nis \"canAccess\"\n3. canAccess() returns true in for the first GameImpl::update() call for \nneutral \nunits (mineral is neutral unit right? @_@)\n4. onFrame() is called in the FIRST GameImpl::update(), which I guess in this \nfirst \ncall, getMinerals returns all minerals.\n\nThis should be easy to verify I will do it later when I go back home :). Also \nnote \nthat onFrame is called twice for the first frame (ln 791 & ln 795 in \nGameImpl.cpp) \nwhich I think it is a bug too.\n```\n\n-----\nOriginal comment by `easonk...@gmail.com` on 25 Nov 2009 at 7:22"}}