{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/164","labels_url":"https://api.github.com/repos/chrsmith/bwapi/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/bwapi/issues/164/comments","events_url":"https://api.github.com/repos/chrsmith/bwapi/issues/164/events","html_url":"https://github.com/chrsmith/bwapi/issues/164","id":58482907,"number":164,"title":"canBuildHere() doesn't return false for hatcheries/nexuses/cc's too close to minerals/gas","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"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Priority-Low","name":"Priority-Low","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-22T00:34:42Z","updated_at":"2015-02-22T00:34:42Z","closed_at":null,"body":"```\nWhat steps will reproduce the problem?\n1. Pick a TilePosition too close to a mineral/geyser\n2. Check the output of canBuildHere\n\nWhat is the expected output? What do you see instead?\nIt should return false if too close in proximity to a resource. It doesn't.\n\nWhat version of the product are you using? On what operating system?\n2.4\n\n```\n\n-----\nOriginal issue reported on code.google.com by `chad.zan...@gmail.com` on 11 Dec 2009 at 2:40"},"comment":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/comments/75406728","html_url":"https://github.com/chrsmith/bwapi/issues/164#issuecomment-75406728","issue_url":"https://api.github.com/repos/chrsmith/bwapi/issues/164","id":75406728,"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-22T00:34:42Z","updated_at":"2015-02-22T00:34:42Z","body":"```\nI'll try to create a basic test-case for you later tonight.\n\nWhat I was doing (don't have access to code ATM):\n\nI wrote quick hack of a function to randomly grab build spots around the center \nof a \nbase's region. It's essentially:\n\ndo {\n  x,y = random offsets from bases' region's center\n} while ( !Broodwar->canBuidHere(NULL, TilePosition(x,y), Zerg_Hatchery ));\n\n\nIt'd would now-and-then return a TilePosition immediately next to or too close \nto my \nextractor.  I might have written the description to hastily, as after reading \nyour \nresponse and some BWAPI code I only noticed the error next to my completed \nextractor.\n\nAccording to the source, it looks like it should check as you say:\n\nhttp://www.google.com/codesearch/p?\nhl=en#5xqY1YZBkWI/trunk/bwapi/BWAPI/Source/BWAPI/Engine.cpp&q=canBuildHere \npackage:http://bwapi\\.googlecode\\.com&sa=N&cd=3&ct=rc&l=611\n\n\nMy guess (if I'm not doing something stupid) is that if ((*i)->canAccess() from \ngetGeysers() is returning false if the geyser has an extractor built on it. \nThis \ndrops the geyser from the returned set and in turn fools canBuildHere into \nreturning \ntrue.\n\nA solution would be to use the static getGeyser function instead, I think.\n\nAgain, none of this has been tested yet.\n\n```\n\n-----\nOriginal comment by `chad.zan...@gmail.com` on 11 Dec 2009 at 11:21"}}