{"action":"created","comment":{"url":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/comments/55119218","id":55119218,"diff_hunk":"@@ -17,51 +19,43 @@ Returns:\n \r\n Author:\r\n     Rommel\r\n-\r\n ---------------------------------------------------------------------------- */\r\n+#include \"script_component.hpp\"\r\n+SCRIPT(setPos);\r\n+\r\n+params [\r\n+    [\"_entity\", objNull, [objNull, grpNull, \"\", locationNull, taskNull]],\r\n+    [\"_position\", nil, [objNull, grpNull, \"\", locationNull, taskNull, []]],\r\n+    [\"_radius\", 0, [0]]\r\n+];\r\n \r\n-private [\"_entity\",\"_position\",\"_radius\"];\r\n-_entity = _this select 0;\r\n-_position = _this select 1;\r\n-_radius = if (count _this > 2) then {_this select 2} else {0};\r\n+if (isNil \"_position\") exitWith {};\r\n \r\n-_position = _position call CBA_fnc_getpos;\r\n+_position = _position call CBA_fnc_getPos;\r\n \r\n if (_radius > 0) then {\r\n     _position = [_position, _radius] call CBA_fnc_randPos;\r\n };\r\n \r\n-switch (typename _entity) do {\r\n+switch (typeName _entity) do {\r\n     case \"OBJECT\" : {\r\n-        _entity setpos _position;\r\n+        _entity setPos _position;\r\n     };\r\n     case \"GROUP\" : {\r\n-        private [\"_ldp\",\"_dx\",\"_dy\",\"_dz\"];\r\n-        _ldp = getpos (leader _entity);\r\n-        _dx = _position select 0;\r\n-        _dy = _position select 1;\r\n-        _dz = _position select 2;\r\n+        private _leaderPos = getPos (leader _entity);\r\n+\r\n         {\r\n-            private [\"_txyz\",\"_tx\", \"_ty\", \"_tz\"];\r\n-            _txyz = _x worldtomodel _ldp;\r\n-            _tx = _dx + (_txyz select 0);\r\n-            _ty = _dy + (_txyz select 1);\r\n-            _tz = _dz + (_txyz select 2);\r\n-            _x setpos [_tx,_ty,_tz];\r\n+            _x setpos (_position vectorAdd (_x worldToModel _leaderPos));\r\n         } foreach (units _entity);\r","path":"addons/common/fnc_setPos.sqf","position":66,"original_position":66,"commit_id":"e03e2016dc00c5b42933db9c8a07165286b62496","original_commit_id":"e03e2016dc00c5b42933db9c8a07165286b62496","user":{"login":"Killswitch00","id":12647603,"avatar_url":"https://avatars.githubusercontent.com/u/12647603?v=3","gravatar_id":"","url":"https://api.github.com/users/Killswitch00","html_url":"https://github.com/Killswitch00","followers_url":"https://api.github.com/users/Killswitch00/followers","following_url":"https://api.github.com/users/Killswitch00/following{/other_user}","gists_url":"https://api.github.com/users/Killswitch00/gists{/gist_id}","starred_url":"https://api.github.com/users/Killswitch00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Killswitch00/subscriptions","organizations_url":"https://api.github.com/users/Killswitch00/orgs","repos_url":"https://api.github.com/users/Killswitch00/repos","events_url":"https://api.github.com/users/Killswitch00/events{/privacy}","received_events_url":"https://api.github.com/users/Killswitch00/received_events","type":"User","site_admin":false},"body":"and worldToModel :-)","created_at":"2016-03-05T10:16:41Z","updated_at":"2016-03-05T10:16:41Z","html_url":"https://github.com/CBATeam/CBA_A3/pull/291#discussion_r55119218","pull_request_url":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/291","_links":{"self":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/comments/55119218"},"html":{"href":"https://github.com/CBATeam/CBA_A3/pull/291#discussion_r55119218"},"pull_request":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/291"}}},"pull_request":{"url":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/291","id":61722709,"html_url":"https://github.com/CBATeam/CBA_A3/pull/291","diff_url":"https://github.com/CBATeam/CBA_A3/pull/291.diff","patch_url":"https://github.com/CBATeam/CBA_A3/pull/291.patch","issue_url":"https://api.github.com/repos/CBATeam/CBA_A3/issues/291","number":291,"state":"open","locked":false,"title":"rework common module","user":{"login":"commy2","id":6576312,"avatar_url":"https://avatars.githubusercontent.com/u/6576312?v=3","gravatar_id":"","url":"https://api.github.com/users/commy2","html_url":"https://github.com/commy2","followers_url":"https://api.github.com/users/commy2/followers","following_url":"https://api.github.com/users/commy2/following{/other_user}","gists_url":"https://api.github.com/users/commy2/gists{/gist_id}","starred_url":"https://api.github.com/users/commy2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commy2/subscriptions","organizations_url":"https://api.github.com/users/commy2/orgs","repos_url":"https://api.github.com/users/commy2/repos","events_url":"https://api.github.com/users/commy2/events{/privacy}","received_events_url":"https://api.github.com/users/commy2/received_events","type":"User","site_admin":false},"body":"same as the other one, but friendlier to review (I hope)","created_at":"2016-03-04T14:59:25Z","updated_at":"2016-03-05T10:16:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6650dec0f51e8594e13b014e4276fda7dbdd4d5b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/291/commits","review_comments_url":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/291/comments","review_comment_url":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CBATeam/CBA_A3/issues/291/comments","statuses_url":"https://api.github.com/repos/CBATeam/CBA_A3/statuses/e03e2016dc00c5b42933db9c8a07165286b62496","head":{"label":"CBATeam:sortcommon4","ref":"sortcommon4","sha":"e03e2016dc00c5b42933db9c8a07165286b62496","user":{"login":"CBATeam","id":12647545,"avatar_url":"https://avatars.githubusercontent.com/u/12647545?v=3","gravatar_id":"","url":"https://api.github.com/users/CBATeam","html_url":"https://github.com/CBATeam","followers_url":"https://api.github.com/users/CBATeam/followers","following_url":"https://api.github.com/users/CBATeam/following{/other_user}","gists_url":"https://api.github.com/users/CBATeam/gists{/gist_id}","starred_url":"https://api.github.com/users/CBATeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBATeam/subscriptions","organizations_url":"https://api.github.com/users/CBATeam/orgs","repos_url":"https://api.github.com/users/CBATeam/repos","events_url":"https://api.github.com/users/CBATeam/events{/privacy}","received_events_url":"https://api.github.com/users/CBATeam/received_events","type":"Organization","site_admin":false},"repo":{"id":36454957,"name":"CBA_A3","full_name":"CBATeam/CBA_A3","owner":{"login":"CBATeam","id":12647545,"avatar_url":"https://avatars.githubusercontent.com/u/12647545?v=3","gravatar_id":"","url":"https://api.github.com/users/CBATeam","html_url":"https://github.com/CBATeam","followers_url":"https://api.github.com/users/CBATeam/followers","following_url":"https://api.github.com/users/CBATeam/following{/other_user}","gists_url":"https://api.github.com/users/CBATeam/gists{/gist_id}","starred_url":"https://api.github.com/users/CBATeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBATeam/subscriptions","organizations_url":"https://api.github.com/users/CBATeam/orgs","repos_url":"https://api.github.com/users/CBATeam/repos","events_url":"https://api.github.com/users/CBATeam/events{/privacy}","received_events_url":"https://api.github.com/users/CBATeam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CBATeam/CBA_A3","description":"Community Base Addons for Arma 3","fork":false,"url":"https://api.github.com/repos/CBATeam/CBA_A3","forks_url":"https://api.github.com/repos/CBATeam/CBA_A3/forks","keys_url":"https://api.github.com/repos/CBATeam/CBA_A3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CBATeam/CBA_A3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CBATeam/CBA_A3/teams","hooks_url":"https://api.github.com/repos/CBATeam/CBA_A3/hooks","issue_events_url":"https://api.github.com/repos/CBATeam/CBA_A3/issues/events{/number}","events_url":"https://api.github.com/repos/CBATeam/CBA_A3/events","assignees_url":"https://api.github.com/repos/CBATeam/CBA_A3/assignees{/user}","branches_url":"https://api.github.com/repos/CBATeam/CBA_A3/branches{/branch}","tags_url":"https://api.github.com/repos/CBATeam/CBA_A3/tags","blobs_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/refs{/sha}","trees_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CBATeam/CBA_A3/statuses/{sha}","languages_url":"https://api.github.com/repos/CBATeam/CBA_A3/languages","stargazers_url":"https://api.github.com/repos/CBATeam/CBA_A3/stargazers","contributors_url":"https://api.github.com/repos/CBATeam/CBA_A3/contributors","subscribers_url":"https://api.github.com/repos/CBATeam/CBA_A3/subscribers","subscription_url":"https://api.github.com/repos/CBATeam/CBA_A3/subscription","commits_url":"https://api.github.com/repos/CBATeam/CBA_A3/commits{/sha}","git_commits_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/commits{/sha}","comments_url":"https://api.github.com/repos/CBATeam/CBA_A3/comments{/number}","issue_comment_url":"https://api.github.com/repos/CBATeam/CBA_A3/issues/comments{/number}","contents_url":"https://api.github.com/repos/CBATeam/CBA_A3/contents/{+path}","compare_url":"https://api.github.com/repos/CBATeam/CBA_A3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CBATeam/CBA_A3/merges","archive_url":"https://api.github.com/repos/CBATeam/CBA_A3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CBATeam/CBA_A3/downloads","issues_url":"https://api.github.com/repos/CBATeam/CBA_A3/issues{/number}","pulls_url":"https://api.github.com/repos/CBATeam/CBA_A3/pulls{/number}","milestones_url":"https://api.github.com/repos/CBATeam/CBA_A3/milestones{/number}","notifications_url":"https://api.github.com/repos/CBATeam/CBA_A3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CBATeam/CBA_A3/labels{/name}","releases_url":"https://api.github.com/repos/CBATeam/CBA_A3/releases{/id}","deployments_url":"https://api.github.com/repos/CBATeam/CBA_A3/deployments","created_at":"2015-05-28T17:34:05Z","updated_at":"2016-03-04T20:12:19Z","pushed_at":"2016-03-05T09:33:53Z","git_url":"git://github.com/CBATeam/CBA_A3.git","ssh_url":"git@github.com:CBATeam/CBA_A3.git","clone_url":"https://github.com/CBATeam/CBA_A3.git","svn_url":"https://github.com/CBATeam/CBA_A3","homepage":"","size":10054,"stargazers_count":63,"watchers_count":63,"language":"SQF","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"open_issues_count":19,"forks":30,"open_issues":19,"watchers":63,"default_branch":"master"}},"base":{"label":"CBATeam:master","ref":"master","sha":"93035289df7ba133be29e686ab7eb5798ce5d940","user":{"login":"CBATeam","id":12647545,"avatar_url":"https://avatars.githubusercontent.com/u/12647545?v=3","gravatar_id":"","url":"https://api.github.com/users/CBATeam","html_url":"https://github.com/CBATeam","followers_url":"https://api.github.com/users/CBATeam/followers","following_url":"https://api.github.com/users/CBATeam/following{/other_user}","gists_url":"https://api.github.com/users/CBATeam/gists{/gist_id}","starred_url":"https://api.github.com/users/CBATeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBATeam/subscriptions","organizations_url":"https://api.github.com/users/CBATeam/orgs","repos_url":"https://api.github.com/users/CBATeam/repos","events_url":"https://api.github.com/users/CBATeam/events{/privacy}","received_events_url":"https://api.github.com/users/CBATeam/received_events","type":"Organization","site_admin":false},"repo":{"id":36454957,"name":"CBA_A3","full_name":"CBATeam/CBA_A3","owner":{"login":"CBATeam","id":12647545,"avatar_url":"https://avatars.githubusercontent.com/u/12647545?v=3","gravatar_id":"","url":"https://api.github.com/users/CBATeam","html_url":"https://github.com/CBATeam","followers_url":"https://api.github.com/users/CBATeam/followers","following_url":"https://api.github.com/users/CBATeam/following{/other_user}","gists_url":"https://api.github.com/users/CBATeam/gists{/gist_id}","starred_url":"https://api.github.com/users/CBATeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBATeam/subscriptions","organizations_url":"https://api.github.com/users/CBATeam/orgs","repos_url":"https://api.github.com/users/CBATeam/repos","events_url":"https://api.github.com/users/CBATeam/events{/privacy}","received_events_url":"https://api.github.com/users/CBATeam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CBATeam/CBA_A3","description":"Community Base Addons for Arma 3","fork":false,"url":"https://api.github.com/repos/CBATeam/CBA_A3","forks_url":"https://api.github.com/repos/CBATeam/CBA_A3/forks","keys_url":"https://api.github.com/repos/CBATeam/CBA_A3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CBATeam/CBA_A3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CBATeam/CBA_A3/teams","hooks_url":"https://api.github.com/repos/CBATeam/CBA_A3/hooks","issue_events_url":"https://api.github.com/repos/CBATeam/CBA_A3/issues/events{/number}","events_url":"https://api.github.com/repos/CBATeam/CBA_A3/events","assignees_url":"https://api.github.com/repos/CBATeam/CBA_A3/assignees{/user}","branches_url":"https://api.github.com/repos/CBATeam/CBA_A3/branches{/branch}","tags_url":"https://api.github.com/repos/CBATeam/CBA_A3/tags","blobs_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/refs{/sha}","trees_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CBATeam/CBA_A3/statuses/{sha}","languages_url":"https://api.github.com/repos/CBATeam/CBA_A3/languages","stargazers_url":"https://api.github.com/repos/CBATeam/CBA_A3/stargazers","contributors_url":"https://api.github.com/repos/CBATeam/CBA_A3/contributors","subscribers_url":"https://api.github.com/repos/CBATeam/CBA_A3/subscribers","subscription_url":"https://api.github.com/repos/CBATeam/CBA_A3/subscription","commits_url":"https://api.github.com/repos/CBATeam/CBA_A3/commits{/sha}","git_commits_url":"https://api.github.com/repos/CBATeam/CBA_A3/git/commits{/sha}","comments_url":"https://api.github.com/repos/CBATeam/CBA_A3/comments{/number}","issue_comment_url":"https://api.github.com/repos/CBATeam/CBA_A3/issues/comments{/number}","contents_url":"https://api.github.com/repos/CBATeam/CBA_A3/contents/{+path}","compare_url":"https://api.github.com/repos/CBATeam/CBA_A3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CBATeam/CBA_A3/merges","archive_url":"https://api.github.com/repos/CBATeam/CBA_A3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CBATeam/CBA_A3/downloads","issues_url":"https://api.github.com/repos/CBATeam/CBA_A3/issues{/number}","pulls_url":"https://api.github.com/repos/CBATeam/CBA_A3/pulls{/number}","milestones_url":"https://api.github.com/repos/CBATeam/CBA_A3/milestones{/number}","notifications_url":"https://api.github.com/repos/CBATeam/CBA_A3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CBATeam/CBA_A3/labels{/name}","releases_url":"https://api.github.com/repos/CBATeam/CBA_A3/releases{/id}","deployments_url":"https://api.github.com/repos/CBATeam/CBA_A3/deployments","created_at":"2015-05-28T17:34:05Z","updated_at":"2016-03-04T20:12:19Z","pushed_at":"2016-03-05T09:33:53Z","git_url":"git://github.com/CBATeam/CBA_A3.git","ssh_url":"git@github.com:CBATeam/CBA_A3.git","clone_url":"https://github.com/CBATeam/CBA_A3.git","svn_url":"https://github.com/CBATeam/CBA_A3","homepage":"","size":10054,"stargazers_count":63,"watchers_count":63,"language":"SQF","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"open_issues_count":19,"forks":30,"open_issues":19,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/291"},"html":{"href":"https://github.com/CBATeam/CBA_A3/pull/291"},"issue":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/issues/291"},"comments":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/issues/291/comments"},"review_comments":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/291/comments"},"review_comment":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/pulls/291/commits"},"statuses":{"href":"https://api.github.com/repos/CBATeam/CBA_A3/statuses/e03e2016dc00c5b42933db9c8a07165286b62496"}}}}