{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/234","labels_url":"https://api.github.com/repos/chrsmith/bwapi/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/bwapi/issues/234/comments","events_url":"https://api.github.com/repos/chrsmith/bwapi/issues/234/events","html_url":"https://github.com/chrsmith/bwapi/issues/234","id":58483014,"number":234,"title":"hasPower not always correct","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/Component-Logic","name":"Component-Logic","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Type-Defect","name":"Type-Defect","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Usability","name":"Usability","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-22T00:36:14Z","updated_at":"2015-02-22T00:36:15Z","closed_at":null,"body":"```\nThe hasPower method returns false in some cases where it should pass, one case \nhighlighted in the following image.\n\nhttp://i.imgur.com/Kkak1.png\n\nThe green tiles are those which return true to hasPower with gateway passed in, \nred for those which dont, but as shown, manually hovering the building \nplacement thing over that tile shows it has power.\n\nThis also means that any build commands sent for this tile will fail.\n\nThe following code was used to display those tiles with power:\n\nint ScreenX = BWAPI::Broodwar->getScreenX() / 32;\nint ScreenY = BWAPI::Broodwar->getScreenY() / 32;\n\nfor (int x = ScreenX; x < ScreenX + 20; ++x)\n{\n\tfor (int y = ScreenY; y < ScreenY + 15; ++y)\n\t{\n\t\tif(BWAPI::Broodwar->hasPower(BWAPI::TilePosition(x, y), BWAPI::UnitTypes::Protoss_Gateway.tileWidth(), BWAPI::UnitTypes::Protoss_Gateway.tileHeight()))\n\t\t\tBWAPI::Broodwar->drawBoxMap((x * 32), (y * 32), (x * 32) + 32, (y * 32) + 32, BWAPI::Colors::Green, false);\n\t\telse\n\t\t\tBWAPI::Broodwar->drawBoxMap((x * 32), (y * 32), (x * 32) + 32, (y * 32) + 32, BWAPI::Colors::Red, false);\n\t}\n}\n```\n\n-----\nOriginal issue reported on code.google.com by `quaver.smith` on 19 Aug 2010 at 9:09"},"comment":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/comments/75407159","html_url":"https://github.com/chrsmith/bwapi/issues/234#issuecomment-75407159","issue_url":"https://api.github.com/repos/chrsmith/bwapi/issues/234","id":75407159,"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:36:15Z","updated_at":"2015-02-22T00:36:15Z","body":"```\nFixed in r2685 (verified)\n```\n\n-----\nOriginal comment by `AHeinerm` on 19 Aug 2010 at 5:25\n* Changed state: **Verified**"}}