{"action":"created","comment":{"url":"https://api.github.com/repos/mc-server/MCServer/pulls/comments/29546550","id":29546550,"diff_hunk":"@@ -0,0 +1,161 @@\n+#pragma once\n+\n+/* Wanna use the pathfinder? Put this in your header file:\n+\n+// Fwd: cPath\n+enum class ePathFinderStatus;\n+class cPath;\n+\n+Put this in your .cpp:\n+#include \"...Path.h\"\n+*/\n+\n+#ifdef COMPILING_PATHFIND_DEBUGGER\n+\t/* Note: the COMPILING_PATHFIND_DEBUGGER flag is used by Native/WiseOldMan95 to debug\n+\tthis class outside of MCServer. This preprocessor flag is never set when compiling MCServer. */\n+\t#include \"PathFinderIrrlicht_Head.h\"\n+#endif\n+\n+#include <unordered_map>\n+\n+/* MCServer forward declarations */\n+#ifndef COMPILING_PATHFIND_DEBUGGER\n+\n+// fwd: cChunkMap.h\n+typedef cItemCallback<cChunk> cChunkCallback;\n+#endif\n+\n+/* Various little structs and classes */\n+enum class ePathFinderStatus {CALCULATING,  PATH_FOUND,  PATH_NOT_FOUND};\n+struct cPathCell;  // Defined inside Path.cpp\n+class compareHeuristics\n+{\n+public:\n+\tbool operator()(cPathCell * & a_V1,  cPathCell * &  a_V2);\n+};\n+\n+class cPath\n+#ifndef COMPILING_PATHFIND_DEBUGGER\n+: public cChunkCallback\n+#endif\n+{\n+public:\n+\t/** Creates a pathfinder instance. A Mob will probably need a single pathfinder instance for its entire life.\n+\n+\tNote that if you have a man-sized mob (1x1x2, zombies, etc), you are advised to call this function without parameters\n+\tbecause the declaration might change in later version of the pathFinder, and a parameter-less call always assumes a man-sized mob.\n+\n+\tIf your mob is not man-sized, you are advised to use cPath(width, height), this would be compatible with future versions,\n+\tbut please be aware that as of now those parameters will be ignored and your mob will be assumed to be man sized.\n+\n+\t@param a_BoundingBoxWidth the character's boundingbox width in blocks. Currently the parameter is ignored and 1 is assumed.\n+\t@param a_BoundingBoxHeight the character's boundingbox width in blocks. Currently the parameter is ignored and 2 is assumed.","path":"src/Mobs/Path.h","position":52,"original_position":52,"commit_id":"1b0e21e0b270b3938b81df119d5a741a3e1e1257","original_commit_id":"1b0e21e0b270b3938b81df119d5a741a3e1e1257","user":{"login":"wiseoldman95","id":5030488,"avatar_url":"https://avatars.githubusercontent.com/u/5030488?v=3","gravatar_id":"","url":"https://api.github.com/users/wiseoldman95","html_url":"https://github.com/wiseoldman95","followers_url":"https://api.github.com/users/wiseoldman95/followers","following_url":"https://api.github.com/users/wiseoldman95/following{/other_user}","gists_url":"https://api.github.com/users/wiseoldman95/gists{/gist_id}","starred_url":"https://api.github.com/users/wiseoldman95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiseoldman95/subscriptions","organizations_url":"https://api.github.com/users/wiseoldman95/orgs","repos_url":"https://api.github.com/users/wiseoldman95/repos","events_url":"https://api.github.com/users/wiseoldman95/events{/privacy}","received_events_url":"https://api.github.com/users/wiseoldman95/received_events","type":"User","site_admin":false},"body":"Speaking of that, I've been thinking that \"cheating\" could be better:\r\nI could assume that all bounding box dimensions are integers, it would work with almost all use cases, then I could hack my way around the exotics, e.g. completely ignoring open doors and pushing all the waypoints half a block up when a ground-facing slab is detected.\r\n\r\nIt keeps the PathFinder codebase much simpler and is much easier to implement than real non-int bounding boxes.\r\nWhat do you think?","created_at":"2015-05-02T09:50:43Z","updated_at":"2015-05-02T09:50:43Z","html_url":"https://github.com/mc-server/MCServer/pull/1920#discussion_r29546550","pull_request_url":"https://api.github.com/repos/mc-server/MCServer/pulls/1920","_links":{"self":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/comments/29546550"},"html":{"href":"https://github.com/mc-server/MCServer/pull/1920#discussion_r29546550"},"pull_request":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/1920"}}},"pull_request":{"url":"https://api.github.com/repos/mc-server/MCServer/pulls/1920","id":34381328,"html_url":"https://github.com/mc-server/MCServer/pull/1920","diff_url":"https://github.com/mc-server/MCServer/pull/1920.diff","patch_url":"https://github.com/mc-server/MCServer/pull/1920.patch","issue_url":"https://api.github.com/repos/mc-server/MCServer/issues/1920","number":1920,"state":"closed","locked":false,"title":"Implemented A* Pathfinding and updated monster.cpp to use it. ","user":{"login":"wiseoldman95","id":5030488,"avatar_url":"https://avatars.githubusercontent.com/u/5030488?v=3","gravatar_id":"","url":"https://api.github.com/users/wiseoldman95","html_url":"https://github.com/wiseoldman95","followers_url":"https://api.github.com/users/wiseoldman95/followers","following_url":"https://api.github.com/users/wiseoldman95/following{/other_user}","gists_url":"https://api.github.com/users/wiseoldman95/gists{/gist_id}","starred_url":"https://api.github.com/users/wiseoldman95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiseoldman95/subscriptions","organizations_url":"https://api.github.com/users/wiseoldman95/orgs","repos_url":"https://api.github.com/users/wiseoldman95/repos","events_url":"https://api.github.com/users/wiseoldman95/events{/privacy}","received_events_url":"https://api.github.com/users/wiseoldman95/received_events","type":"User","site_admin":false},"body":"Squashed version of https://github.com/mc-server/MCServer/pull/1916","created_at":"2015-04-29T16:33:54Z","updated_at":"2015-05-02T09:50:44Z","closed_at":"2015-05-01T11:47:48Z","merged_at":"2015-05-01T11:47:48Z","merge_commit_sha":"dc0c8d376230da9ff9c1972d1b72c0ed5947269c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mc-server/MCServer/pulls/1920/commits","review_comments_url":"https://api.github.com/repos/mc-server/MCServer/pulls/1920/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/1920/comments","statuses_url":"https://api.github.com/repos/mc-server/MCServer/statuses/1b0e21e0b270b3938b81df119d5a741a3e1e1257","head":{"label":"wiseoldman95:SquashedPathFinder","ref":"SquashedPathFinder","sha":"1b0e21e0b270b3938b81df119d5a741a3e1e1257","user":{"login":"wiseoldman95","id":5030488,"avatar_url":"https://avatars.githubusercontent.com/u/5030488?v=3","gravatar_id":"","url":"https://api.github.com/users/wiseoldman95","html_url":"https://github.com/wiseoldman95","followers_url":"https://api.github.com/users/wiseoldman95/followers","following_url":"https://api.github.com/users/wiseoldman95/following{/other_user}","gists_url":"https://api.github.com/users/wiseoldman95/gists{/gist_id}","starred_url":"https://api.github.com/users/wiseoldman95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiseoldman95/subscriptions","organizations_url":"https://api.github.com/users/wiseoldman95/orgs","repos_url":"https://api.github.com/users/wiseoldman95/repos","events_url":"https://api.github.com/users/wiseoldman95/events{/privacy}","received_events_url":"https://api.github.com/users/wiseoldman95/received_events","type":"User","site_admin":false},"repo":{"id":18560372,"name":"MCServer","full_name":"wiseoldman95/MCServer","owner":{"login":"wiseoldman95","id":5030488,"avatar_url":"https://avatars.githubusercontent.com/u/5030488?v=3","gravatar_id":"","url":"https://api.github.com/users/wiseoldman95","html_url":"https://github.com/wiseoldman95","followers_url":"https://api.github.com/users/wiseoldman95/followers","following_url":"https://api.github.com/users/wiseoldman95/following{/other_user}","gists_url":"https://api.github.com/users/wiseoldman95/gists{/gist_id}","starred_url":"https://api.github.com/users/wiseoldman95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiseoldman95/subscriptions","organizations_url":"https://api.github.com/users/wiseoldman95/orgs","repos_url":"https://api.github.com/users/wiseoldman95/repos","events_url":"https://api.github.com/users/wiseoldman95/events{/privacy}","received_events_url":"https://api.github.com/users/wiseoldman95/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wiseoldman95/MCServer","description":"A performant C++ Minecraft Server","fork":true,"url":"https://api.github.com/repos/wiseoldman95/MCServer","forks_url":"https://api.github.com/repos/wiseoldman95/MCServer/forks","keys_url":"https://api.github.com/repos/wiseoldman95/MCServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wiseoldman95/MCServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wiseoldman95/MCServer/teams","hooks_url":"https://api.github.com/repos/wiseoldman95/MCServer/hooks","issue_events_url":"https://api.github.com/repos/wiseoldman95/MCServer/issues/events{/number}","events_url":"https://api.github.com/repos/wiseoldman95/MCServer/events","assignees_url":"https://api.github.com/repos/wiseoldman95/MCServer/assignees{/user}","branches_url":"https://api.github.com/repos/wiseoldman95/MCServer/branches{/branch}","tags_url":"https://api.github.com/repos/wiseoldman95/MCServer/tags","blobs_url":"https://api.github.com/repos/wiseoldman95/MCServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wiseoldman95/MCServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wiseoldman95/MCServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/wiseoldman95/MCServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wiseoldman95/MCServer/statuses/{sha}","languages_url":"https://api.github.com/repos/wiseoldman95/MCServer/languages","stargazers_url":"https://api.github.com/repos/wiseoldman95/MCServer/stargazers","contributors_url":"https://api.github.com/repos/wiseoldman95/MCServer/contributors","subscribers_url":"https://api.github.com/repos/wiseoldman95/MCServer/subscribers","subscription_url":"https://api.github.com/repos/wiseoldman95/MCServer/subscription","commits_url":"https://api.github.com/repos/wiseoldman95/MCServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/wiseoldman95/MCServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/wiseoldman95/MCServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/wiseoldman95/MCServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/wiseoldman95/MCServer/contents/{+path}","compare_url":"https://api.github.com/repos/wiseoldman95/MCServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wiseoldman95/MCServer/merges","archive_url":"https://api.github.com/repos/wiseoldman95/MCServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wiseoldman95/MCServer/downloads","issues_url":"https://api.github.com/repos/wiseoldman95/MCServer/issues{/number}","pulls_url":"https://api.github.com/repos/wiseoldman95/MCServer/pulls{/number}","milestones_url":"https://api.github.com/repos/wiseoldman95/MCServer/milestones{/number}","notifications_url":"https://api.github.com/repos/wiseoldman95/MCServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wiseoldman95/MCServer/labels{/name}","releases_url":"https://api.github.com/repos/wiseoldman95/MCServer/releases{/id}","created_at":"2014-04-08T14:02:07Z","updated_at":"2015-05-01T12:36:01Z","pushed_at":"2015-05-02T08:15:55Z","git_url":"git://github.com/wiseoldman95/MCServer.git","ssh_url":"git@github.com:wiseoldman95/MCServer.git","clone_url":"https://github.com/wiseoldman95/MCServer.git","svn_url":"https://github.com/wiseoldman95/MCServer","homepage":"mc-server.org","size":73884,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mc-server:master","ref":"master","sha":"259132d17e53ec99c4eb00cd856260d14ea1234d","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-01T11:47:48Z","pushed_at":"2015-05-02T08:15:55Z","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":161536,"stargazers_count":462,"watchers_count":462,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":164,"mirror_url":null,"open_issues_count":296,"forks":164,"open_issues":296,"watchers":462,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/1920"},"html":{"href":"https://github.com/mc-server/MCServer/pull/1920"},"issue":{"href":"https://api.github.com/repos/mc-server/MCServer/issues/1920"},"comments":{"href":"https://api.github.com/repos/mc-server/MCServer/issues/1920/comments"},"review_comments":{"href":"https://api.github.com/repos/mc-server/MCServer/pulls/1920/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/1920/commits"},"statuses":{"href":"https://api.github.com/repos/mc-server/MCServer/statuses/1b0e21e0b270b3938b81df119d5a741a3e1e1257"}}}}