{"action":"created","comment":{"url":"https://api.github.com/repos/acemod/ACE3/pulls/comments/186631882","pull_request_review_id":118245531,"id":186631882,"diff_hunk":"@@ -1,7 +1,42 @@\n // by esteldunedain\n #include \"script_component.hpp\"\n \n+// eject destroyed vehicle init\n+[QGVAR(ejectDestroyed),{\n+    TRACE_2(\"ejectDestroyed event\",_this,typeOf _this);\n+    _this removeEventHandler [\"HandleDamage\", _this getVariable QGVAR(ejectDestroyedHDEH)];\n+    _this setVariable [QGVAR(ejectDestroyedHDEH), nil];\n+}] call CBA_fnc_addEventHandler;\n+private _ejectDestroyedClasses = [];\n+{\n+    private _ejectDestroyedClass = configName _x;\n+    if (-1 == _ejectDestroyedClasses findIf {_ejectDestroyedClass isKindOf _x}) then {\n+        TRACE_1(\"init ejectDestroyed class\",_ejectDestroyedClass);\n+        _ejectDestroyedClasses pushBack _ejectDestroyedClass;\n+        [_ejectDestroyedClass, \"init\", {\n+            params [\"_vehicle\"];\n+            if (!alive _vehicle) exitWith {};\n+            TRACE_2(\"init ejectDestroyed vehicle\",_vehicle,typeOf _vehicle);\n+            private _eh = _vehicle addEventHandler [\"HandleDamage\", {\n+                params [\"_vehicle\"];\n+                if (!alive _vehicle) then {\n+                    TRACE_1(\"ejectDestroyed ejectDestroyedHDEH\",_this);\n+                    {\n+                        if (alive _x) then {\n+                            moveOut _x;\n+                        };\n+                    } forEach crew _vehicle;\n+                    [QGVAR(ejectDestroyed), _vehicle] call CBA_fnc_globalEvent;\n+                };\n+            }];\n+            _vehicle setVariable [QGVAR(ejectDestroyedHDEH), _eh];","path":"addons/vehicles/XEH_postInit.sqf","position":32,"original_position":32,"commit_id":"61e0f7b668c71975c61e99d67cf56b02bf0ad573","original_commit_id":"61e0f7b668c71975c61e99d67cf56b02bf0ad573","user":{"login":"SilentSpike","id":5459452,"avatar_url":"https://avatars3.githubusercontent.com/u/5459452?v=4","gravatar_id":"","url":"https://api.github.com/users/SilentSpike","html_url":"https://github.com/SilentSpike","followers_url":"https://api.github.com/users/SilentSpike/followers","following_url":"https://api.github.com/users/SilentSpike/following{/other_user}","gists_url":"https://api.github.com/users/SilentSpike/gists{/gist_id}","starred_url":"https://api.github.com/users/SilentSpike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SilentSpike/subscriptions","organizations_url":"https://api.github.com/users/SilentSpike/orgs","repos_url":"https://api.github.com/users/SilentSpike/repos","events_url":"https://api.github.com/users/SilentSpike/events{/privacy}","received_events_url":"https://api.github.com/users/SilentSpike/received_events","type":"User","site_admin":false},"body":"🤔 Huh? Of course you have `_thisEventHandler` everywhere, it's a block of code used in an event handler added with `addEventHandler`.\r\n\r\nPersonally I would much rather have some leftover event handlers on some machines which will remove themselves if a dead vehicle ever changes locality and takes a single hit of damage again (which, let's be honest, isn't likely). It will make the code more elegant and remove unnecessary network traffic.","created_at":"2018-05-08T06:53:50Z","updated_at":"2018-05-08T06:53:51Z","html_url":"https://github.com/acemod/ACE3/pull/6330#discussion_r186631882","pull_request_url":"https://api.github.com/repos/acemod/ACE3/pulls/6330","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/acemod/ACE3/pulls/comments/186631882"},"html":{"href":"https://github.com/acemod/ACE3/pull/6330#discussion_r186631882"},"pull_request":{"href":"https://api.github.com/repos/acemod/ACE3/pulls/6330"}},"in_reply_to_id":186558490},"pull_request":{"url":"https://api.github.com/repos/acemod/ACE3/pulls/6330","id":186463301,"html_url":"https://github.com/acemod/ACE3/pull/6330","diff_url":"https://github.com/acemod/ACE3/pull/6330.diff","patch_url":"https://github.com/acemod/ACE3/pull/6330.patch","issue_url":"https://api.github.com/repos/acemod/ACE3/issues/6330","number":6330,"state":"open","locked":false,"title":"Add destroyed boat ejecting","user":{"login":"Dystopian","id":3867143,"avatar_url":"https://avatars3.githubusercontent.com/u/3867143?v=4","gravatar_id":"","url":"https://api.github.com/users/Dystopian","html_url":"https://github.com/Dystopian","followers_url":"https://api.github.com/users/Dystopian/followers","following_url":"https://api.github.com/users/Dystopian/following{/other_user}","gists_url":"https://api.github.com/users/Dystopian/gists{/gist_id}","starred_url":"https://api.github.com/users/Dystopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dystopian/subscriptions","organizations_url":"https://api.github.com/users/Dystopian/orgs","repos_url":"https://api.github.com/users/Dystopian/repos","events_url":"https://api.github.com/users/Dystopian/events{/privacy}","received_events_url":"https://api.github.com/users/Dystopian/received_events","type":"User","site_admin":false},"body":"**When merged this pull request will:**\r\n- add destroyed boat ejecting framework;\r\n- make `Rubber Boat`, `Water Scooter`, `RHIB` eject crew if destroyed.\r\n\r\nSome boats like rubber boat or scooter are very easy to destroy even with 1-2 bullets or if they are just collided with other object (especially by engine). It's OK except it kills its crew (Arma feature) even if it's not really possible. This PR adds `HandleDamage` event handler which ejects crew when boat is destroyed.\r\n\r\nThis way has at least one defect: ejected crew is not damaged with any projectile type. You can destroy boat with grenade, HE rocket or even explosive charge but crew will survive when eject. From my point of view it's not a big deal in comparison with dying from stone collision but maybe you think otherwise.\r\n\r\nConfig values are safe for 3rd-party mods and can be easily added to them. E.g. CUP has suitable Zodiac and RHIB boats.\r\n\r\nI also tested solution with `allowDamage` command but it has more bugs without any advantages.","created_at":"2018-05-07T21:00:23Z","updated_at":"2018-05-08T06:53:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ecfc7c8405455e7b18da59aa53d1cc2b217f493","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":164934320,"url":"https://api.github.com/repos/acemod/ACE3/labels/kind/feature%20request","name":"kind/feature request","color":"006b75","default":false}],"milestone":{"url":"https://api.github.com/repos/acemod/ACE3/milestones/35","html_url":"https://github.com/acemod/ACE3/milestone/35","labels_url":"https://api.github.com/repos/acemod/ACE3/milestones/35/labels","id":2862352,"number":35,"title":"3.13.0","description":"","creator":{"login":"jonpas","id":7935003,"avatar_url":"https://avatars3.githubusercontent.com/u/7935003?v=4","gravatar_id":"","url":"https://api.github.com/users/jonpas","html_url":"https://github.com/jonpas","followers_url":"https://api.github.com/users/jonpas/followers","following_url":"https://api.github.com/users/jonpas/following{/other_user}","gists_url":"https://api.github.com/users/jonpas/gists{/gist_id}","starred_url":"https://api.github.com/users/jonpas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonpas/subscriptions","organizations_url":"https://api.github.com/users/jonpas/orgs","repos_url":"https://api.github.com/users/jonpas/repos","events_url":"https://api.github.com/users/jonpas/events{/privacy}","received_events_url":"https://api.github.com/users/jonpas/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":17,"state":"open","created_at":"2017-10-24T13:45:06Z","updated_at":"2018-05-07T21:52:20Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/acemod/ACE3/pulls/6330/commits","review_comments_url":"https://api.github.com/repos/acemod/ACE3/pulls/6330/comments","review_comment_url":"https://api.github.com/repos/acemod/ACE3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acemod/ACE3/issues/6330/comments","statuses_url":"https://api.github.com/repos/acemod/ACE3/statuses/61e0f7b668c71975c61e99d67cf56b02bf0ad573","head":{"label":"Dystopian:prevent_death_in_boat","ref":"prevent_death_in_boat","sha":"61e0f7b668c71975c61e99d67cf56b02bf0ad573","user":{"login":"Dystopian","id":3867143,"avatar_url":"https://avatars3.githubusercontent.com/u/3867143?v=4","gravatar_id":"","url":"https://api.github.com/users/Dystopian","html_url":"https://github.com/Dystopian","followers_url":"https://api.github.com/users/Dystopian/followers","following_url":"https://api.github.com/users/Dystopian/following{/other_user}","gists_url":"https://api.github.com/users/Dystopian/gists{/gist_id}","starred_url":"https://api.github.com/users/Dystopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dystopian/subscriptions","organizations_url":"https://api.github.com/users/Dystopian/orgs","repos_url":"https://api.github.com/users/Dystopian/repos","events_url":"https://api.github.com/users/Dystopian/events{/privacy}","received_events_url":"https://api.github.com/users/Dystopian/received_events","type":"User","site_admin":false},"repo":{"id":69102267,"name":"ACE3","full_name":"Dystopian/ACE3","owner":{"login":"Dystopian","id":3867143,"avatar_url":"https://avatars3.githubusercontent.com/u/3867143?v=4","gravatar_id":"","url":"https://api.github.com/users/Dystopian","html_url":"https://github.com/Dystopian","followers_url":"https://api.github.com/users/Dystopian/followers","following_url":"https://api.github.com/users/Dystopian/following{/other_user}","gists_url":"https://api.github.com/users/Dystopian/gists{/gist_id}","starred_url":"https://api.github.com/users/Dystopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dystopian/subscriptions","organizations_url":"https://api.github.com/users/Dystopian/orgs","repos_url":"https://api.github.com/users/Dystopian/repos","events_url":"https://api.github.com/users/Dystopian/events{/privacy}","received_events_url":"https://api.github.com/users/Dystopian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dystopian/ACE3","description":"Open-source realism mod for Arma 3","fork":true,"url":"https://api.github.com/repos/Dystopian/ACE3","forks_url":"https://api.github.com/repos/Dystopian/ACE3/forks","keys_url":"https://api.github.com/repos/Dystopian/ACE3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dystopian/ACE3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dystopian/ACE3/teams","hooks_url":"https://api.github.com/repos/Dystopian/ACE3/hooks","issue_events_url":"https://api.github.com/repos/Dystopian/ACE3/issues/events{/number}","events_url":"https://api.github.com/repos/Dystopian/ACE3/events","assignees_url":"https://api.github.com/repos/Dystopian/ACE3/assignees{/user}","branches_url":"https://api.github.com/repos/Dystopian/ACE3/branches{/branch}","tags_url":"https://api.github.com/repos/Dystopian/ACE3/tags","blobs_url":"https://api.github.com/repos/Dystopian/ACE3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dystopian/ACE3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dystopian/ACE3/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dystopian/ACE3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dystopian/ACE3/statuses/{sha}","languages_url":"https://api.github.com/repos/Dystopian/ACE3/languages","stargazers_url":"https://api.github.com/repos/Dystopian/ACE3/stargazers","contributors_url":"https://api.github.com/repos/Dystopian/ACE3/contributors","subscribers_url":"https://api.github.com/repos/Dystopian/ACE3/subscribers","subscription_url":"https://api.github.com/repos/Dystopian/ACE3/subscription","commits_url":"https://api.github.com/repos/Dystopian/ACE3/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dystopian/ACE3/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dystopian/ACE3/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dystopian/ACE3/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dystopian/ACE3/contents/{+path}","compare_url":"https://api.github.com/repos/Dystopian/ACE3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dystopian/ACE3/merges","archive_url":"https://api.github.com/repos/Dystopian/ACE3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dystopian/ACE3/downloads","issues_url":"https://api.github.com/repos/Dystopian/ACE3/issues{/number}","pulls_url":"https://api.github.com/repos/Dystopian/ACE3/pulls{/number}","milestones_url":"https://api.github.com/repos/Dystopian/ACE3/milestones{/number}","notifications_url":"https://api.github.com/repos/Dystopian/ACE3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dystopian/ACE3/labels{/name}","releases_url":"https://api.github.com/repos/Dystopian/ACE3/releases{/id}","deployments_url":"https://api.github.com/repos/Dystopian/ACE3/deployments","created_at":"2016-09-24T12:56:35Z","updated_at":"2016-09-24T12:56:43Z","pushed_at":"2018-05-07T20:58:38Z","git_url":"git://github.com/Dystopian/ACE3.git","ssh_url":"git@github.com:Dystopian/ACE3.git","clone_url":"https://github.com/Dystopian/ACE3.git","svn_url":"https://github.com/Dystopian/ACE3","homepage":"http://ace3mod.com/","size":353955,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"acemod:master","ref":"master","sha":"2fae6754f54a56d91f51e12c6761351eebc496e5","user":{"login":"acemod","id":11369030,"avatar_url":"https://avatars3.githubusercontent.com/u/11369030?v=4","gravatar_id":"","url":"https://api.github.com/users/acemod","html_url":"https://github.com/acemod","followers_url":"https://api.github.com/users/acemod/followers","following_url":"https://api.github.com/users/acemod/following{/other_user}","gists_url":"https://api.github.com/users/acemod/gists{/gist_id}","starred_url":"https://api.github.com/users/acemod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acemod/subscriptions","organizations_url":"https://api.github.com/users/acemod/orgs","repos_url":"https://api.github.com/users/acemod/repos","events_url":"https://api.github.com/users/acemod/events{/privacy}","received_events_url":"https://api.github.com/users/acemod/received_events","type":"Organization","site_admin":false},"repo":{"id":29069174,"name":"ACE3","full_name":"acemod/ACE3","owner":{"login":"acemod","id":11369030,"avatar_url":"https://avatars3.githubusercontent.com/u/11369030?v=4","gravatar_id":"","url":"https://api.github.com/users/acemod","html_url":"https://github.com/acemod","followers_url":"https://api.github.com/users/acemod/followers","following_url":"https://api.github.com/users/acemod/following{/other_user}","gists_url":"https://api.github.com/users/acemod/gists{/gist_id}","starred_url":"https://api.github.com/users/acemod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acemod/subscriptions","organizations_url":"https://api.github.com/users/acemod/orgs","repos_url":"https://api.github.com/users/acemod/repos","events_url":"https://api.github.com/users/acemod/events{/privacy}","received_events_url":"https://api.github.com/users/acemod/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acemod/ACE3","description":"Open-source realism mod for Arma 3","fork":false,"url":"https://api.github.com/repos/acemod/ACE3","forks_url":"https://api.github.com/repos/acemod/ACE3/forks","keys_url":"https://api.github.com/repos/acemod/ACE3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acemod/ACE3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acemod/ACE3/teams","hooks_url":"https://api.github.com/repos/acemod/ACE3/hooks","issue_events_url":"https://api.github.com/repos/acemod/ACE3/issues/events{/number}","events_url":"https://api.github.com/repos/acemod/ACE3/events","assignees_url":"https://api.github.com/repos/acemod/ACE3/assignees{/user}","branches_url":"https://api.github.com/repos/acemod/ACE3/branches{/branch}","tags_url":"https://api.github.com/repos/acemod/ACE3/tags","blobs_url":"https://api.github.com/repos/acemod/ACE3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acemod/ACE3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acemod/ACE3/git/refs{/sha}","trees_url":"https://api.github.com/repos/acemod/ACE3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acemod/ACE3/statuses/{sha}","languages_url":"https://api.github.com/repos/acemod/ACE3/languages","stargazers_url":"https://api.github.com/repos/acemod/ACE3/stargazers","contributors_url":"https://api.github.com/repos/acemod/ACE3/contributors","subscribers_url":"https://api.github.com/repos/acemod/ACE3/subscribers","subscription_url":"https://api.github.com/repos/acemod/ACE3/subscription","commits_url":"https://api.github.com/repos/acemod/ACE3/commits{/sha}","git_commits_url":"https://api.github.com/repos/acemod/ACE3/git/commits{/sha}","comments_url":"https://api.github.com/repos/acemod/ACE3/comments{/number}","issue_comment_url":"https://api.github.com/repos/acemod/ACE3/issues/comments{/number}","contents_url":"https://api.github.com/repos/acemod/ACE3/contents/{+path}","compare_url":"https://api.github.com/repos/acemod/ACE3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acemod/ACE3/merges","archive_url":"https://api.github.com/repos/acemod/ACE3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acemod/ACE3/downloads","issues_url":"https://api.github.com/repos/acemod/ACE3/issues{/number}","pulls_url":"https://api.github.com/repos/acemod/ACE3/pulls{/number}","milestones_url":"https://api.github.com/repos/acemod/ACE3/milestones{/number}","notifications_url":"https://api.github.com/repos/acemod/ACE3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acemod/ACE3/labels{/name}","releases_url":"https://api.github.com/repos/acemod/ACE3/releases{/id}","deployments_url":"https://api.github.com/repos/acemod/ACE3/deployments","created_at":"2015-01-10T19:59:12Z","updated_at":"2018-05-07T21:44:32Z","pushed_at":"2018-05-07T21:44:16Z","git_url":"git://github.com/acemod/ACE3.git","ssh_url":"git@github.com:acemod/ACE3.git","clone_url":"https://github.com/acemod/ACE3.git","svn_url":"https://github.com/acemod/ACE3","homepage":"https://ace3mod.com/","size":371063,"stargazers_count":587,"watchers_count":587,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":479,"mirror_url":null,"archived":false,"open_issues_count":350,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":479,"open_issues":350,"watchers":587,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acemod/ACE3/pulls/6330"},"html":{"href":"https://github.com/acemod/ACE3/pull/6330"},"issue":{"href":"https://api.github.com/repos/acemod/ACE3/issues/6330"},"comments":{"href":"https://api.github.com/repos/acemod/ACE3/issues/6330/comments"},"review_comments":{"href":"https://api.github.com/repos/acemod/ACE3/pulls/6330/comments"},"review_comment":{"href":"https://api.github.com/repos/acemod/ACE3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acemod/ACE3/pulls/6330/commits"},"statuses":{"href":"https://api.github.com/repos/acemod/ACE3/statuses/61e0f7b668c71975c61e99d67cf56b02bf0ad573"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"SilentSpike"}}