{"action":"created","comment":{"url":"https://api.github.com/repos/mc-server/MCServer/pulls/comments/31365728","id":31365728,"diff_hunk":"@@ -348,47 +391,30 @@ class cIncrementalRedstoneSimulator :\n \t\t}\n \t}\n \n-\tinline static bool AreCoordsOnChunkBoundary(int a_BlockX, int a_BlockY, int a_BlockZ)\n+\tinline static bool DoesIgnorePlayerToggle(BLOCKTYPE a_Block)\n \t{\n-\t\treturn (  // Are we on a chunk boundary? +- 2 because of LinkedPowered blocks\n-\t\t\t((a_BlockX % cChunkDef::Width) <= 1) ||\n-\t\t\t((a_BlockX % cChunkDef::Width) >= 14) ||\n-\t\t\t((a_BlockZ % cChunkDef::Width) <= 1) ||\n-\t\t\t((a_BlockZ % cChunkDef::Width) >= 14)\n-\t\t\t);\n-\t}\n-\n-\tinline static Vector3i AdjustRelativeCoords(const Vector3i & a_RelPosition)\n-\t{\n-\t\tif (\n-\t\t\t(a_RelPosition.x >= 0) && (a_RelPosition.x < cChunkDef::Width) &&\n-\t\t\t(a_RelPosition.z >= 0) && (a_RelPosition.z < cChunkDef::Width)\n-\t\t\t)\n+\t\tswitch (a_Block)\n \t\t{\n-\t\t\treturn a_RelPosition;\n+\t\t\tcase E_BLOCK_ACACIA_FENCE_GATE:\n+\t\t\tcase E_BLOCK_BIRCH_FENCE_GATE:\n+\t\t\tcase E_BLOCK_DARK_OAK_FENCE_GATE:\n+\t\t\tcase E_BLOCK_FENCE_GATE:\n+\t\t\tcase E_BLOCK_JUNGLE_FENCE_GATE:\n+\t\t\tcase E_BLOCK_SPRUCE_FENCE_GATE:\n+\t\t\tcase E_BLOCK_IRON_TRAPDOOR:\n+\t\t\tcase E_BLOCK_TRAPDOOR:\n+\t\t\t{\n+\t\t\t\treturn true;\n+\t\t\t}\n+\t\t\tdefault: return false;\n \t\t}\n+\t}\n \n-\t\tVector3i RelPos = a_RelPosition;\n+\tinline static std::vector<cChunk *> GetAdjacentChunks(const Vector3i & a_RelBlockPosition, cChunk * a_Chunk);\n \n-\t\t// Request for a different chunk, calculate chunk offset:\n-\t\twhile (RelPos.x >= cChunkDef::Width)\n-\t\t{\n-\t\t\tRelPos.x -= cChunkDef::Width;\n-\t\t}\n-\t\twhile (RelPos.x < 0)\n-\t\t{\n-\t\t\tRelPos.x += cChunkDef::Width;\n-\t\t}\n-\t\twhile (RelPos.z >= cChunkDef::Width)\n-\t\t{\n-\t\t\tRelPos.z -= cChunkDef::Width;\n-\t\t}\n-\t\twhile (RelPos.z < 0)\n-\t\t{\n-\t\t\tRelPos.z += cChunkDef::Width;\n-\t\t}\n-\n-\t\treturn RelPos;\n+\tinline static Vector3i AdjustRelativeCoords(const Vector3i & a_RelPosition)\n+\t{\n+\t\treturn Vector3i((a_RelPosition.x % cChunkDef::Width + cChunkDef::Width) % cChunkDef::Width, a_RelPosition.y, (a_RelPosition.z % cChunkDef::Width + cChunkDef::Width) % cChunkDef::Width);\n \t}","path":"src/Simulator/IncrementalRedstoneSimulator.h","position":366,"original_position":333,"commit_id":"acfb4d00b4dffe991faaf2433118516655b51cfd","original_commit_id":"e6f85533eceaa45b60b72f3487752f3b82b4c0ab","user":{"login":"madmaxoft","id":4388386,"avatar_url":"https://avatars.githubusercontent.com/u/4388386?v=3","gravatar_id":"","url":"https://api.github.com/users/madmaxoft","html_url":"https://github.com/madmaxoft","followers_url":"https://api.github.com/users/madmaxoft/followers","following_url":"https://api.github.com/users/madmaxoft/following{/other_user}","gists_url":"https://api.github.com/users/madmaxoft/gists{/gist_id}","starred_url":"https://api.github.com/users/madmaxoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madmaxoft/subscriptions","organizations_url":"https://api.github.com/users/madmaxoft/orgs","repos_url":"https://api.github.com/users/madmaxoft/repos","events_url":"https://api.github.com/users/madmaxoft/events{/privacy}","received_events_url":"https://api.github.com/users/madmaxoft/received_events","type":"User","site_admin":false},"body":"You might want to consider splitting the long line, each param on a separate line (plus separate line for the closing parenthesis, of course)","created_at":"2015-05-29T21:17:59Z","updated_at":"2015-05-29T21:17:59Z","html_url":"https://github.com/mc-server/MCServer/pull/2144#discussion_r31365728","pull_request_url":"https://api.github.com/repos/mc-server/MCServer/pulls/2144","_links":{"self":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/comments/31365728"},"html":{"href":"https://github.com/mc-server/MCServer/pull/2144#discussion_r31365728"},"pull_request":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/2144"}}},"pull_request":{"url":"https://api.github.com/repos/mc-server/MCServer/pulls/2144","id":36256825,"html_url":"https://github.com/mc-server/MCServer/pull/2144","diff_url":"https://github.com/mc-server/MCServer/pull/2144.diff","patch_url":"https://github.com/mc-server/MCServer/pull/2144.patch","issue_url":"https://api.github.com/repos/mc-server/MCServer/issues/2144","number":2144,"state":"open","locked":false,"title":"Redstone improvements [SEE DESC]","user":{"login":"tigerw","id":2939130,"avatar_url":"https://avatars.githubusercontent.com/u/2939130?v=3","gravatar_id":"","url":"https://api.github.com/users/tigerw","html_url":"https://github.com/tigerw","followers_url":"https://api.github.com/users/tigerw/followers","following_url":"https://api.github.com/users/tigerw/following{/other_user}","gists_url":"https://api.github.com/users/tigerw/gists{/gist_id}","starred_url":"https://api.github.com/users/tigerw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tigerw/subscriptions","organizations_url":"https://api.github.com/users/tigerw/orgs","repos_url":"https://api.github.com/users/tigerw/repos","events_url":"https://api.github.com/users/tigerw/events{/privacy}","received_events_url":"https://api.github.com/users/tigerw/received_events","type":"User","site_admin":false},"body":"+ Partially implemented comparators\r\n+ Wires now power on/off simultaneously\r\n* Potential performance improvements\r\n* Improvements to linked powering\r\n* Fixes #1887\r\n* Fixes #1763\r\n* Fixes #1083\r\n* Fixes #2009","created_at":"2015-05-26T23:45:17Z","updated_at":"2015-05-29T21:17:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ae6cb9bba71da5cbd692acdd68c0657cdb3aaf0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mc-server/MCServer/pulls/2144/commits","review_comments_url":"https://api.github.com/repos/mc-server/MCServer/pulls/2144/comments","review_comment_url":"https://api.github.com/repos/mc-server/MCServer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mc-server/MCServer/issues/2144/comments","statuses_url":"https://api.github.com/repos/mc-server/MCServer/statuses/acfb4d00b4dffe991faaf2433118516655b51cfd","head":{"label":"mc-server:comparators","ref":"comparators","sha":"acfb4d00b4dffe991faaf2433118516655b51cfd","user":{"login":"mc-server","id":5096476,"avatar_url":"https://avatars.githubusercontent.com/u/5096476?v=3","gravatar_id":"","url":"https://api.github.com/users/mc-server","html_url":"https://github.com/mc-server","followers_url":"https://api.github.com/users/mc-server/followers","following_url":"https://api.github.com/users/mc-server/following{/other_user}","gists_url":"https://api.github.com/users/mc-server/gists{/gist_id}","starred_url":"https://api.github.com/users/mc-server/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mc-server/subscriptions","organizations_url":"https://api.github.com/users/mc-server/orgs","repos_url":"https://api.github.com/users/mc-server/repos","events_url":"https://api.github.com/users/mc-server/events{/privacy}","received_events_url":"https://api.github.com/users/mc-server/received_events","type":"Organization","site_admin":false},"repo":{"id":11693709,"name":"MCServer","full_name":"mc-server/MCServer","owner":{"login":"mc-server","id":5096476,"avatar_url":"https://avatars.githubusercontent.com/u/5096476?v=3","gravatar_id":"","url":"https://api.github.com/users/mc-server","html_url":"https://github.com/mc-server","followers_url":"https://api.github.com/users/mc-server/followers","following_url":"https://api.github.com/users/mc-server/following{/other_user}","gists_url":"https://api.github.com/users/mc-server/gists{/gist_id}","starred_url":"https://api.github.com/users/mc-server/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mc-server/subscriptions","organizations_url":"https://api.github.com/users/mc-server/orgs","repos_url":"https://api.github.com/users/mc-server/repos","events_url":"https://api.github.com/users/mc-server/events{/privacy}","received_events_url":"https://api.github.com/users/mc-server/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mc-server/MCServer","description":"A performant C++ Minecraft Server","fork":false,"url":"https://api.github.com/repos/mc-server/MCServer","forks_url":"https://api.github.com/repos/mc-server/MCServer/forks","keys_url":"https://api.github.com/repos/mc-server/MCServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mc-server/MCServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mc-server/MCServer/teams","hooks_url":"https://api.github.com/repos/mc-server/MCServer/hooks","issue_events_url":"https://api.github.com/repos/mc-server/MCServer/issues/events{/number}","events_url":"https://api.github.com/repos/mc-server/MCServer/events","assignees_url":"https://api.github.com/repos/mc-server/MCServer/assignees{/user}","branches_url":"https://api.github.com/repos/mc-server/MCServer/branches{/branch}","tags_url":"https://api.github.com/repos/mc-server/MCServer/tags","blobs_url":"https://api.github.com/repos/mc-server/MCServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mc-server/MCServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mc-server/MCServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/mc-server/MCServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mc-server/MCServer/statuses/{sha}","languages_url":"https://api.github.com/repos/mc-server/MCServer/languages","stargazers_url":"https://api.github.com/repos/mc-server/MCServer/stargazers","contributors_url":"https://api.github.com/repos/mc-server/MCServer/contributors","subscribers_url":"https://api.github.com/repos/mc-server/MCServer/subscribers","subscription_url":"https://api.github.com/repos/mc-server/MCServer/subscription","commits_url":"https://api.github.com/repos/mc-server/MCServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/mc-server/MCServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/mc-server/MCServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/mc-server/MCServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/mc-server/MCServer/contents/{+path}","compare_url":"https://api.github.com/repos/mc-server/MCServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mc-server/MCServer/merges","archive_url":"https://api.github.com/repos/mc-server/MCServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mc-server/MCServer/downloads","issues_url":"https://api.github.com/repos/mc-server/MCServer/issues{/number}","pulls_url":"https://api.github.com/repos/mc-server/MCServer/pulls{/number}","milestones_url":"https://api.github.com/repos/mc-server/MCServer/milestones{/number}","notifications_url":"https://api.github.com/repos/mc-server/MCServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mc-server/MCServer/labels{/name}","releases_url":"https://api.github.com/repos/mc-server/MCServer/releases{/id}","created_at":"2013-07-26T19:56:59Z","updated_at":"2015-05-29T05:15:55Z","pushed_at":"2015-05-29T20:53:02Z","git_url":"git://github.com/mc-server/MCServer.git","ssh_url":"git@github.com:mc-server/MCServer.git","clone_url":"https://github.com/mc-server/MCServer.git","svn_url":"https://github.com/mc-server/MCServer","homepage":"mc-server.org","size":165901,"stargazers_count":652,"watchers_count":652,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":326,"forks":194,"open_issues":326,"watchers":652,"default_branch":"master"}},"base":{"label":"mc-server:master","ref":"master","sha":"0fb7628e96d3a8ee0225cd4c912fde362b722be2","user":{"login":"mc-server","id":5096476,"avatar_url":"https://avatars.githubusercontent.com/u/5096476?v=3","gravatar_id":"","url":"https://api.github.com/users/mc-server","html_url":"https://github.com/mc-server","followers_url":"https://api.github.com/users/mc-server/followers","following_url":"https://api.github.com/users/mc-server/following{/other_user}","gists_url":"https://api.github.com/users/mc-server/gists{/gist_id}","starred_url":"https://api.github.com/users/mc-server/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mc-server/subscriptions","organizations_url":"https://api.github.com/users/mc-server/orgs","repos_url":"https://api.github.com/users/mc-server/repos","events_url":"https://api.github.com/users/mc-server/events{/privacy}","received_events_url":"https://api.github.com/users/mc-server/received_events","type":"Organization","site_admin":false},"repo":{"id":11693709,"name":"MCServer","full_name":"mc-server/MCServer","owner":{"login":"mc-server","id":5096476,"avatar_url":"https://avatars.githubusercontent.com/u/5096476?v=3","gravatar_id":"","url":"https://api.github.com/users/mc-server","html_url":"https://github.com/mc-server","followers_url":"https://api.github.com/users/mc-server/followers","following_url":"https://api.github.com/users/mc-server/following{/other_user}","gists_url":"https://api.github.com/users/mc-server/gists{/gist_id}","starred_url":"https://api.github.com/users/mc-server/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mc-server/subscriptions","organizations_url":"https://api.github.com/users/mc-server/orgs","repos_url":"https://api.github.com/users/mc-server/repos","events_url":"https://api.github.com/users/mc-server/events{/privacy}","received_events_url":"https://api.github.com/users/mc-server/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mc-server/MCServer","description":"A performant C++ Minecraft Server","fork":false,"url":"https://api.github.com/repos/mc-server/MCServer","forks_url":"https://api.github.com/repos/mc-server/MCServer/forks","keys_url":"https://api.github.com/repos/mc-server/MCServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mc-server/MCServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mc-server/MCServer/teams","hooks_url":"https://api.github.com/repos/mc-server/MCServer/hooks","issue_events_url":"https://api.github.com/repos/mc-server/MCServer/issues/events{/number}","events_url":"https://api.github.com/repos/mc-server/MCServer/events","assignees_url":"https://api.github.com/repos/mc-server/MCServer/assignees{/user}","branches_url":"https://api.github.com/repos/mc-server/MCServer/branches{/branch}","tags_url":"https://api.github.com/repos/mc-server/MCServer/tags","blobs_url":"https://api.github.com/repos/mc-server/MCServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mc-server/MCServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mc-server/MCServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/mc-server/MCServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mc-server/MCServer/statuses/{sha}","languages_url":"https://api.github.com/repos/mc-server/MCServer/languages","stargazers_url":"https://api.github.com/repos/mc-server/MCServer/stargazers","contributors_url":"https://api.github.com/repos/mc-server/MCServer/contributors","subscribers_url":"https://api.github.com/repos/mc-server/MCServer/subscribers","subscription_url":"https://api.github.com/repos/mc-server/MCServer/subscription","commits_url":"https://api.github.com/repos/mc-server/MCServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/mc-server/MCServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/mc-server/MCServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/mc-server/MCServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/mc-server/MCServer/contents/{+path}","compare_url":"https://api.github.com/repos/mc-server/MCServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mc-server/MCServer/merges","archive_url":"https://api.github.com/repos/mc-server/MCServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mc-server/MCServer/downloads","issues_url":"https://api.github.com/repos/mc-server/MCServer/issues{/number}","pulls_url":"https://api.github.com/repos/mc-server/MCServer/pulls{/number}","milestones_url":"https://api.github.com/repos/mc-server/MCServer/milestones{/number}","notifications_url":"https://api.github.com/repos/mc-server/MCServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mc-server/MCServer/labels{/name}","releases_url":"https://api.github.com/repos/mc-server/MCServer/releases{/id}","created_at":"2013-07-26T19:56:59Z","updated_at":"2015-05-29T05:15:55Z","pushed_at":"2015-05-29T20:53:02Z","git_url":"git://github.com/mc-server/MCServer.git","ssh_url":"git@github.com:mc-server/MCServer.git","clone_url":"https://github.com/mc-server/MCServer.git","svn_url":"https://github.com/mc-server/MCServer","homepage":"mc-server.org","size":165901,"stargazers_count":652,"watchers_count":652,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":326,"forks":194,"open_issues":326,"watchers":652,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/2144"},"html":{"href":"https://github.com/mc-server/MCServer/pull/2144"},"issue":{"href":"https://api.github.com/repos/mc-server/MCServer/issues/2144"},"comments":{"href":"https://api.github.com/repos/mc-server/MCServer/issues/2144/comments"},"review_comments":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/2144/comments"},"review_comment":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/2144/commits"},"statuses":{"href":"https://api.github.com/repos/mc-server/MCServer/statuses/acfb4d00b4dffe991faaf2433118516655b51cfd"}}}}