{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/241","labels_url":"https://api.github.com/repos/chrsmith/bwapi/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/bwapi/issues/241/comments","events_url":"https://api.github.com/repos/chrsmith/bwapi/issues/241/events","html_url":"https://github.com/chrsmith/bwapi/issues/241","id":58483985,"number":241,"title":"Incorrect Game::canMake() logic for Zerg Greater Spire","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":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-22T00:56:16Z","updated_at":"2015-02-22T00:56:17Z","closed_at":null,"body":"```\nWhat steps will reproduce the problem?\n\n(all steps assume sufficient resources available)\n\n1. Make a Spire, call canMake() on a Mutalisk, returns true as expected\n2. Morph Spire to a Greater Spire, call canMake() on a Mutalisk, returns false, \nunexpected\n\nWhat is the expected output? What do you see instead?\n\nWe should be able to make a mutalisk with a greater spire only, not a spire.\n\nWhat version of the product are you using? On what operating system?\n\nLatest BWAPI, Windows 7\n\nPlease provide any additional information below.\n\nMay need to hard code Mutalisk / Scourge into canMake(), don't see an easy fix \nfor adding an OR to your current prerequisite std::map system\n```\n\n-----\nOriginal issue reported on code.google.com by `dave.chu...@gmail.com` on 22 Sep 2010 at 9:25"},"comment":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/comments/75409946","html_url":"https://github.com/chrsmith/bwapi/issues/241#issuecomment-75409946","issue_url":"https://api.github.com/repos/chrsmith/bwapi/issues/241","id":75409946,"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:56:17Z","updated_at":"2015-02-22T00:56:17Z","body":"```\nYeah this code looks like it will work\n\nI was also thinking, although nothing in the game currently requires two \nhatcheries, just to make your code even safer, consider the following:\n\nIf a unit required 2 hatcheries, your current checks will fail if you have 1 \nLair and 1 Hive. I think a better implementation would be to check if:\n\nif ( i->first == UnitTypes::Zerg_Hatchery &&\n           (self()->completedUnitCount(UnitTypes::Zerg_Lair) +\n            self()->completedUnitCount(UnitTypes::Zerg_Hive) >= i->second) )\n        pass = true;\n\nReplacing the || with the + makes this operation safe in case something weird \nhappens to a future patch, which in all probability won't happen.\n```\n\n-----\nOriginal comment by `dave.chu...@gmail.com` on 23 Sep 2010 at 12:27"}}