{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/489","labels_url":"https://api.github.com/repos/chrsmith/bwapi/issues/489/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/bwapi/issues/489/comments","events_url":"https://api.github.com/repos/chrsmith/bwapi/issues/489/events","html_url":"https://github.com/chrsmith/bwapi/issues/489","id":58932714,"number":489,"title":"Can't build/land/etc on far right and/or bottom edge of the map","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-High","name":"Priority-High","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":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-25T16:56:21Z","updated_at":"2015-02-25T16:56:21Z","closed_at":"2015-02-25T16:56:21Z","body":"```\nWhat steps will reproduce the problem?\n1. Call canBuildHere(), placing a building at a clear location whose edge is \nagainst the far right and/or bottom edge of the map.\n\nWhat is the expected output? What do you see instead?\nIt should return true, but it always returns false.\n\nWhat version of the product are you using? On what operating system?\nHEAD of branch bwapi4 of the src\n\nPlease provide any additional information below.\nI think Shared\\Templates.h:canBuildHere is returning false because the rb \nvariable is initialised to an invalid location (i.e. off the edge of the map) \nduring this statement:\n\nTilePosition rb = position + TilePosition(width, height);\n\n\nIt would probably be simple to fix this function, but I expect that similar \nbugs exist in several other places in the BWAPI src, and there may be a lot of \nsrc in BWAPI (and other libraries & bots) that is only called if this function \nreturns true and manipulates position-related objects without doing map array \nbounds safety checks.\n\nMy concern is that if just this function is fixed then unless all such src is \nfixed too then there may be crashes or strange problems caused by memory \ncorruption, and these bugs may be hard to reproduce/debug because they would \nprobably only occur in rare scenarios, and may not even be consistently \nreproducable.\n\nSo, risk may not be worth the effort.\n```\n\n-----\nOriginal issue reported on code.google.com by `chris.c...@gmail.com` on 23 May 2013 at 2:01"},"comment":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/comments/76000946","html_url":"https://github.com/chrsmith/bwapi/issues/489#issuecomment-76000946","issue_url":"https://api.github.com/repos/chrsmith/bwapi/issues/489","id":76000946,"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-25T16:56:21Z","updated_at":"2015-02-25T16:56:21Z","body":"```\nFixed in r4381.\n\n```\n\n-----\nOriginal comment by `AHeinerm` on 23 May 2013 at 7:27\n* Changed state: **Fixed**\n* Added labels: **Type-Defect**, **Priority-High**, **Usability**, **Component-Logic**"}}