{"action":"created","comment":{"url":"https://api.github.com/repos/openscope/openscope/pulls/comments/112065859","pull_request_review_id":33353158,"id":112065859,"diff_hunk":"@@ -1558,28 +1558,29 @@ export default class AircraftInstanceModel {\n      * @method updateWarning\n      */\n     updateSpeedPhysics() {\n-        let difference = null;\n+        let speedChange = 0;\n+        const differenceBetweenPresentAndTargetSpeeds = this.speed - this.target.speed;\n+        const decelerationFactorDueToGroundBraking = 3.5;\n \n-        if (this.target.speed < this.speed - 0.01) {\n-            difference = -this.model.rate.decelerate * window.gameController.game_delta() / 2;\n+        if (differenceBetweenPresentAndTargetSpeeds === 0) {\n+            return;\n+        }\n+\n+        if (this.speed > this.target.speed) {\n+            speedChange = -this.model.rate.decelerate * window.gameController.game_delta() / 2;\n \n             if (this.isOnGround()) {\n-                // What is 3.5 is this restiance/breaking power?\n-                difference *= 3.5;\n+                speedChange *= decelerationFactorDueToGroundBraking;\n             }\n-        } else if (this.target.speed > this.speed + 0.01) {\n-            difference  = this.model.rate.accelerate * window.gameController.game_delta() / 2;\n-            difference *= extrapolate_range_clamp(0, this.speed, this.model.speed.min, 2, 1);\n+        } else if (this.speed < this.target.speed) {\n+            speedChange  = this.model.rate.accelerate * window.gameController.game_delta() / 2;\n+            speedChange *= extrapolate_range_clamp(0, this.speed, this.model.speed.min, 2, 1);","path":"src/assets/scripts/client/aircraft/AircraftInstanceModel.js","position":28,"original_position":28,"commit_id":"2d94b7936b750c7dc193713af3e617b995ed52a2","original_commit_id":"2d94b7936b750c7dc193713af3e617b995ed52a2","user":{"login":"erikquinn","id":5103735,"avatar_url":"https://avatars3.githubusercontent.com/u/5103735?v=3","gravatar_id":"","url":"https://api.github.com/users/erikquinn","html_url":"https://github.com/erikquinn","followers_url":"https://api.github.com/users/erikquinn/followers","following_url":"https://api.github.com/users/erikquinn/following{/other_user}","gists_url":"https://api.github.com/users/erikquinn/gists{/gist_id}","starred_url":"https://api.github.com/users/erikquinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikquinn/subscriptions","organizations_url":"https://api.github.com/users/erikquinn/orgs","repos_url":"https://api.github.com/users/erikquinn/repos","events_url":"https://api.github.com/users/erikquinn/events{/privacy}","received_events_url":"https://api.github.com/users/erikquinn/received_events","type":"User","site_admin":false},"body":"Honestly couldn't really make sense of it. Seems backwards, but obviously it's right. Some convoluted solution that's above my head at the moment.","created_at":"2017-04-18T21:14:37Z","updated_at":"2017-04-18T21:14:37Z","html_url":"https://github.com/openscope/openscope/pull/341#discussion_r112065859","pull_request_url":"https://api.github.com/repos/openscope/openscope/pulls/341","_links":{"self":{"href":"https://api.github.com/repos/openscope/openscope/pulls/comments/112065859"},"html":{"href":"https://github.com/openscope/openscope/pull/341#discussion_r112065859"},"pull_request":{"href":"https://api.github.com/repos/openscope/openscope/pulls/341"}}},"pull_request":{"url":"https://api.github.com/repos/openscope/openscope/pulls/341","id":116416804,"html_url":"https://github.com/openscope/openscope/pull/341","diff_url":"https://github.com/openscope/openscope/pull/341.diff","patch_url":"https://github.com/openscope/openscope/pull/341.patch","issue_url":"https://api.github.com/repos/openscope/openscope/issues/341","number":341,"state":"open","locked":false,"title":"bugfix/340","user":{"login":"erikquinn","id":5103735,"avatar_url":"https://avatars3.githubusercontent.com/u/5103735?v=3","gravatar_id":"","url":"https://api.github.com/users/erikquinn","html_url":"https://github.com/erikquinn","followers_url":"https://api.github.com/users/erikquinn/followers","following_url":"https://api.github.com/users/erikquinn/following{/other_user}","gists_url":"https://api.github.com/users/erikquinn/gists{/gist_id}","starred_url":"https://api.github.com/users/erikquinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikquinn/subscriptions","organizations_url":"https://api.github.com/users/erikquinn/orgs","repos_url":"https://api.github.com/users/erikquinn/repos","events_url":"https://api.github.com/users/erikquinn/events{/privacy}","received_events_url":"https://api.github.com/users/erikquinn/received_events","type":"User","site_admin":false},"body":"Resolves #340.\r\n\r\nEnsures aircraft reach targeted speeds.","created_at":"2017-04-18T20:45:12Z","updated_at":"2017-04-18T21:14:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5e69a9988196bbf183c0ee44b131fdafabd144e","assignee":{"login":"erikquinn","id":5103735,"avatar_url":"https://avatars3.githubusercontent.com/u/5103735?v=3","gravatar_id":"","url":"https://api.github.com/users/erikquinn","html_url":"https://github.com/erikquinn","followers_url":"https://api.github.com/users/erikquinn/followers","following_url":"https://api.github.com/users/erikquinn/following{/other_user}","gists_url":"https://api.github.com/users/erikquinn/gists{/gist_id}","starred_url":"https://api.github.com/users/erikquinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikquinn/subscriptions","organizations_url":"https://api.github.com/users/erikquinn/orgs","repos_url":"https://api.github.com/users/erikquinn/repos","events_url":"https://api.github.com/users/erikquinn/events{/privacy}","received_events_url":"https://api.github.com/users/erikquinn/received_events","type":"User","site_admin":false},"assignees":[{"login":"erikquinn","id":5103735,"avatar_url":"https://avatars3.githubusercontent.com/u/5103735?v=3","gravatar_id":"","url":"https://api.github.com/users/erikquinn","html_url":"https://github.com/erikquinn","followers_url":"https://api.github.com/users/erikquinn/followers","following_url":"https://api.github.com/users/erikquinn/following{/other_user}","gists_url":"https://api.github.com/users/erikquinn/gists{/gist_id}","starred_url":"https://api.github.com/users/erikquinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikquinn/subscriptions","organizations_url":"https://api.github.com/users/erikquinn/orgs","repos_url":"https://api.github.com/users/erikquinn/repos","events_url":"https://api.github.com/users/erikquinn/events{/privacy}","received_events_url":"https://api.github.com/users/erikquinn/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/openscope/openscope/milestones/2","html_url":"https://github.com/openscope/openscope/milestone/2","labels_url":"https://api.github.com/repos/openscope/openscope/milestones/2/labels","id":2260309,"number":2,"title":"v5.0.0","description":"","creator":{"login":"n8rzz","id":3325985,"avatar_url":"https://avatars2.githubusercontent.com/u/3325985?v=3","gravatar_id":"","url":"https://api.github.com/users/n8rzz","html_url":"https://github.com/n8rzz","followers_url":"https://api.github.com/users/n8rzz/followers","following_url":"https://api.github.com/users/n8rzz/following{/other_user}","gists_url":"https://api.github.com/users/n8rzz/gists{/gist_id}","starred_url":"https://api.github.com/users/n8rzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n8rzz/subscriptions","organizations_url":"https://api.github.com/users/n8rzz/orgs","repos_url":"https://api.github.com/users/n8rzz/repos","events_url":"https://api.github.com/users/n8rzz/events{/privacy}","received_events_url":"https://api.github.com/users/n8rzz/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":42,"state":"open","created_at":"2017-01-18T02:53:36Z","updated_at":"2017-04-18T21:04:36Z","due_on":"2017-04-17T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/openscope/openscope/pulls/341/commits","review_comments_url":"https://api.github.com/repos/openscope/openscope/pulls/341/comments","review_comment_url":"https://api.github.com/repos/openscope/openscope/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openscope/openscope/issues/341/comments","statuses_url":"https://api.github.com/repos/openscope/openscope/statuses/2d94b7936b750c7dc193713af3e617b995ed52a2","head":{"label":"openscope:bugfix/340","ref":"bugfix/340","sha":"2d94b7936b750c7dc193713af3e617b995ed52a2","user":{"login":"openscope","id":19348939,"avatar_url":"https://avatars3.githubusercontent.com/u/19348939?v=3","gravatar_id":"","url":"https://api.github.com/users/openscope","html_url":"https://github.com/openscope","followers_url":"https://api.github.com/users/openscope/followers","following_url":"https://api.github.com/users/openscope/following{/other_user}","gists_url":"https://api.github.com/users/openscope/gists{/gist_id}","starred_url":"https://api.github.com/users/openscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openscope/subscriptions","organizations_url":"https://api.github.com/users/openscope/orgs","repos_url":"https://api.github.com/users/openscope/repos","events_url":"https://api.github.com/users/openscope/events{/privacy}","received_events_url":"https://api.github.com/users/openscope/received_events","type":"Organization","site_admin":false},"repo":{"id":77648370,"name":"openscope","full_name":"openscope/openscope","owner":{"login":"openscope","id":19348939,"avatar_url":"https://avatars3.githubusercontent.com/u/19348939?v=3","gravatar_id":"","url":"https://api.github.com/users/openscope","html_url":"https://github.com/openscope","followers_url":"https://api.github.com/users/openscope/followers","following_url":"https://api.github.com/users/openscope/following{/other_user}","gists_url":"https://api.github.com/users/openscope/gists{/gist_id}","starred_url":"https://api.github.com/users/openscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openscope/subscriptions","organizations_url":"https://api.github.com/users/openscope/orgs","repos_url":"https://api.github.com/users/openscope/repos","events_url":"https://api.github.com/users/openscope/events{/privacy}","received_events_url":"https://api.github.com/users/openscope/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openscope/openscope","description":"openScope Air Traffic Control Simulator","fork":false,"url":"https://api.github.com/repos/openscope/openscope","forks_url":"https://api.github.com/repos/openscope/openscope/forks","keys_url":"https://api.github.com/repos/openscope/openscope/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openscope/openscope/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openscope/openscope/teams","hooks_url":"https://api.github.com/repos/openscope/openscope/hooks","issue_events_url":"https://api.github.com/repos/openscope/openscope/issues/events{/number}","events_url":"https://api.github.com/repos/openscope/openscope/events","assignees_url":"https://api.github.com/repos/openscope/openscope/assignees{/user}","branches_url":"https://api.github.com/repos/openscope/openscope/branches{/branch}","tags_url":"https://api.github.com/repos/openscope/openscope/tags","blobs_url":"https://api.github.com/repos/openscope/openscope/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openscope/openscope/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openscope/openscope/git/refs{/sha}","trees_url":"https://api.github.com/repos/openscope/openscope/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openscope/openscope/statuses/{sha}","languages_url":"https://api.github.com/repos/openscope/openscope/languages","stargazers_url":"https://api.github.com/repos/openscope/openscope/stargazers","contributors_url":"https://api.github.com/repos/openscope/openscope/contributors","subscribers_url":"https://api.github.com/repos/openscope/openscope/subscribers","subscription_url":"https://api.github.com/repos/openscope/openscope/subscription","commits_url":"https://api.github.com/repos/openscope/openscope/commits{/sha}","git_commits_url":"https://api.github.com/repos/openscope/openscope/git/commits{/sha}","comments_url":"https://api.github.com/repos/openscope/openscope/comments{/number}","issue_comment_url":"https://api.github.com/repos/openscope/openscope/issues/comments{/number}","contents_url":"https://api.github.com/repos/openscope/openscope/contents/{+path}","compare_url":"https://api.github.com/repos/openscope/openscope/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openscope/openscope/merges","archive_url":"https://api.github.com/repos/openscope/openscope/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openscope/openscope/downloads","issues_url":"https://api.github.com/repos/openscope/openscope/issues{/number}","pulls_url":"https://api.github.com/repos/openscope/openscope/pulls{/number}","milestones_url":"https://api.github.com/repos/openscope/openscope/milestones{/number}","notifications_url":"https://api.github.com/repos/openscope/openscope/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openscope/openscope/labels{/name}","releases_url":"https://api.github.com/repos/openscope/openscope/releases{/id}","deployments_url":"https://api.github.com/repos/openscope/openscope/deployments","created_at":"2016-12-30T00:32:13Z","updated_at":"2017-04-17T11:29:07Z","pushed_at":"2017-04-18T20:45:12Z","git_url":"git://github.com/openscope/openscope.git","ssh_url":"git@github.com:openscope/openscope.git","clone_url":"https://github.com/openscope/openscope.git","svn_url":"https://github.com/openscope/openscope","homepage":"http://www.openscope.co","size":12243,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":190,"forks":12,"open_issues":190,"watchers":34,"default_branch":"develop"}},"base":{"label":"openscope:develop","ref":"develop","sha":"f40cd95d11195c9161df4a3629cb54860a617c30","user":{"login":"openscope","id":19348939,"avatar_url":"https://avatars3.githubusercontent.com/u/19348939?v=3","gravatar_id":"","url":"https://api.github.com/users/openscope","html_url":"https://github.com/openscope","followers_url":"https://api.github.com/users/openscope/followers","following_url":"https://api.github.com/users/openscope/following{/other_user}","gists_url":"https://api.github.com/users/openscope/gists{/gist_id}","starred_url":"https://api.github.com/users/openscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openscope/subscriptions","organizations_url":"https://api.github.com/users/openscope/orgs","repos_url":"https://api.github.com/users/openscope/repos","events_url":"https://api.github.com/users/openscope/events{/privacy}","received_events_url":"https://api.github.com/users/openscope/received_events","type":"Organization","site_admin":false},"repo":{"id":77648370,"name":"openscope","full_name":"openscope/openscope","owner":{"login":"openscope","id":19348939,"avatar_url":"https://avatars3.githubusercontent.com/u/19348939?v=3","gravatar_id":"","url":"https://api.github.com/users/openscope","html_url":"https://github.com/openscope","followers_url":"https://api.github.com/users/openscope/followers","following_url":"https://api.github.com/users/openscope/following{/other_user}","gists_url":"https://api.github.com/users/openscope/gists{/gist_id}","starred_url":"https://api.github.com/users/openscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openscope/subscriptions","organizations_url":"https://api.github.com/users/openscope/orgs","repos_url":"https://api.github.com/users/openscope/repos","events_url":"https://api.github.com/users/openscope/events{/privacy}","received_events_url":"https://api.github.com/users/openscope/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openscope/openscope","description":"openScope Air Traffic Control Simulator","fork":false,"url":"https://api.github.com/repos/openscope/openscope","forks_url":"https://api.github.com/repos/openscope/openscope/forks","keys_url":"https://api.github.com/repos/openscope/openscope/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openscope/openscope/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openscope/openscope/teams","hooks_url":"https://api.github.com/repos/openscope/openscope/hooks","issue_events_url":"https://api.github.com/repos/openscope/openscope/issues/events{/number}","events_url":"https://api.github.com/repos/openscope/openscope/events","assignees_url":"https://api.github.com/repos/openscope/openscope/assignees{/user}","branches_url":"https://api.github.com/repos/openscope/openscope/branches{/branch}","tags_url":"https://api.github.com/repos/openscope/openscope/tags","blobs_url":"https://api.github.com/repos/openscope/openscope/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openscope/openscope/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openscope/openscope/git/refs{/sha}","trees_url":"https://api.github.com/repos/openscope/openscope/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openscope/openscope/statuses/{sha}","languages_url":"https://api.github.com/repos/openscope/openscope/languages","stargazers_url":"https://api.github.com/repos/openscope/openscope/stargazers","contributors_url":"https://api.github.com/repos/openscope/openscope/contributors","subscribers_url":"https://api.github.com/repos/openscope/openscope/subscribers","subscription_url":"https://api.github.com/repos/openscope/openscope/subscription","commits_url":"https://api.github.com/repos/openscope/openscope/commits{/sha}","git_commits_url":"https://api.github.com/repos/openscope/openscope/git/commits{/sha}","comments_url":"https://api.github.com/repos/openscope/openscope/comments{/number}","issue_comment_url":"https://api.github.com/repos/openscope/openscope/issues/comments{/number}","contents_url":"https://api.github.com/repos/openscope/openscope/contents/{+path}","compare_url":"https://api.github.com/repos/openscope/openscope/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openscope/openscope/merges","archive_url":"https://api.github.com/repos/openscope/openscope/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openscope/openscope/downloads","issues_url":"https://api.github.com/repos/openscope/openscope/issues{/number}","pulls_url":"https://api.github.com/repos/openscope/openscope/pulls{/number}","milestones_url":"https://api.github.com/repos/openscope/openscope/milestones{/number}","notifications_url":"https://api.github.com/repos/openscope/openscope/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openscope/openscope/labels{/name}","releases_url":"https://api.github.com/repos/openscope/openscope/releases{/id}","deployments_url":"https://api.github.com/repos/openscope/openscope/deployments","created_at":"2016-12-30T00:32:13Z","updated_at":"2017-04-17T11:29:07Z","pushed_at":"2017-04-18T20:45:12Z","git_url":"git://github.com/openscope/openscope.git","ssh_url":"git@github.com:openscope/openscope.git","clone_url":"https://github.com/openscope/openscope.git","svn_url":"https://github.com/openscope/openscope","homepage":"http://www.openscope.co","size":12243,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":190,"forks":12,"open_issues":190,"watchers":34,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/openscope/openscope/pulls/341"},"html":{"href":"https://github.com/openscope/openscope/pull/341"},"issue":{"href":"https://api.github.com/repos/openscope/openscope/issues/341"},"comments":{"href":"https://api.github.com/repos/openscope/openscope/issues/341/comments"},"review_comments":{"href":"https://api.github.com/repos/openscope/openscope/pulls/341/comments"},"review_comment":{"href":"https://api.github.com/repos/openscope/openscope/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openscope/openscope/pulls/341/commits"},"statuses":{"href":"https://api.github.com/repos/openscope/openscope/statuses/2d94b7936b750c7dc193713af3e617b995ed52a2"}}}}
{"actor":{"display_login":"erikquinn"}}