{"action":"created","issue":{"url":"https://api.github.com/repos/Baystation12/Baystation12/issues/9254","labels_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/9254/labels{/name}","comments_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/9254/comments","events_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/9254/events","html_url":"https://github.com/Baystation12/Baystation12/pull/9254","id":76123791,"number":9254,"title":"Using more energy than a cell has stored now drains the cell.","user":{"login":"PsiOmegaDelta","id":496895,"avatar_url":"https://avatars.githubusercontent.com/u/496895?v=3","gravatar_id":"","url":"https://api.github.com/users/PsiOmegaDelta","html_url":"https://github.com/PsiOmegaDelta","followers_url":"https://api.github.com/users/PsiOmegaDelta/followers","following_url":"https://api.github.com/users/PsiOmegaDelta/following{/other_user}","gists_url":"https://api.github.com/users/PsiOmegaDelta/gists{/gist_id}","starred_url":"https://api.github.com/users/PsiOmegaDelta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PsiOmegaDelta/subscriptions","organizations_url":"https://api.github.com/users/PsiOmegaDelta/orgs","repos_url":"https://api.github.com/users/PsiOmegaDelta/repos","events_url":"https://api.github.com/users/PsiOmegaDelta/events{/privacy}","received_events_url":"https://api.github.com/users/PsiOmegaDelta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-13T21:08:57Z","updated_at":"2015-05-13T21:16:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Baystation12/Baystation12/pulls/9254","html_url":"https://github.com/Baystation12/Baystation12/pull/9254","diff_url":"https://github.com/Baystation12/Baystation12/pull/9254.diff","patch_url":"https://github.com/Baystation12/Baystation12/pull/9254.patch"},"body":"Fixes #9252.\r\n\r\nAlternative solution to the issue in question:\r\n````cell.use(max(cell.charge, amount))````\r\n"},"comment":{"url":"https://api.github.com/repos/Baystation12/Baystation12/issues/comments/101818273","html_url":"https://github.com/Baystation12/Baystation12/pull/9254#issuecomment-101818273","issue_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/9254","id":101818273,"user":{"login":"Miniature","id":1147527,"avatar_url":"https://avatars.githubusercontent.com/u/1147527?v=3","gravatar_id":"","url":"https://api.github.com/users/Miniature","html_url":"https://github.com/Miniature","followers_url":"https://api.github.com/users/Miniature/followers","following_url":"https://api.github.com/users/Miniature/following{/other_user}","gists_url":"https://api.github.com/users/Miniature/gists{/gist_id}","starred_url":"https://api.github.com/users/Miniature/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Miniature/subscriptions","organizations_url":"https://api.github.com/users/Miniature/orgs","repos_url":"https://api.github.com/users/Miniature/repos","events_url":"https://api.github.com/users/Miniature/events{/privacy}","received_events_url":"https://api.github.com/users/Miniature/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T21:16:18Z","updated_at":"2015-05-13T21:16:18Z","body":"imo things should be turning themselves off before they fully drain the battery if they have a flat requirement, but this sort of thing seems like it would be useful as a stopgap for that sort of thing (doing the method suggested as the alternative would fix it for this particular issue, but wouldnt stop it from popping up again elsewhere)\r\n\r\nis there any particular reason why the whole thing isnt `return charge = max(0, charge - amount)`?"}}