{"action":"closed","number":232,"pull_request":{"url":"https://api.github.com/repos/rwengine/openrw/pulls/232","id":83804259,"html_url":"https://github.com/rwengine/openrw/pull/232","diff_url":"https://github.com/rwengine/openrw/pull/232.diff","patch_url":"https://github.com/rwengine/openrw/pull/232.patch","issue_url":"https://api.github.com/repos/rwengine/openrw/issues/232","number":232,"state":"closed","locked":false,"title":"Cheat handler + Money display","user":{"login":"JayFoxRox","id":360330,"avatar_url":"https://avatars.githubusercontent.com/u/360330?v=3","gravatar_id":"","url":"https://api.github.com/users/JayFoxRox","html_url":"https://github.com/JayFoxRox","followers_url":"https://api.github.com/users/JayFoxRox/followers","following_url":"https://api.github.com/users/JayFoxRox/following{/other_user}","gists_url":"https://api.github.com/users/JayFoxRox/gists{/gist_id}","starred_url":"https://api.github.com/users/JayFoxRox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayFoxRox/subscriptions","organizations_url":"https://api.github.com/users/JayFoxRox/orgs","repos_url":"https://api.github.com/users/JayFoxRox/repos","events_url":"https://api.github.com/users/JayFoxRox/events{/privacy}","received_events_url":"https://api.github.com/users/JayFoxRox/received_events","type":"User","site_admin":false},"body":"This implements a cheat handler.\r\nOnly a couple of cheats are actually implemented.\r\nThere will have to be some decision how we will differentiate different official R* versions of GTA3 as cheats were changed in different regions and updates. I've added some defines near the cheat handler as a temporary workaround.\r\n\r\nThis also fixes some issue with the game state which broke the \"IFIWEREARICHMAN\" cheat (money used to be `uint16_t` in OpenRW, and so many other values which are listed as dword on gtamodding).\r\n\r\nAs I was messing with the money values anyway I decided to improve the money display.\r\nIt's now zero-padded to 8 digits. The value also increases slowly now.\r\nThe behaviour for the [money counting was reverse engineered (from a video) and documented here](https://docs.google.com/spreadsheets/d/1VwUk-HeDuJ_yC7p9vIhhoCzII7TPcZOvNGGOj1TjfIs/edit#gid=0). As you can see, OpenRW counts slightly faster than the original. I guess this is related to frameskips and being bound to framerate on the actual game. As OpenRW is running with dynamic timestep I introduced a timer instead and retrieve the 30Hz from that.\r\n\r\n---\r\n\r\nThis causes crashes if cheats are typed before going ingame. Note that the actual game accepts cheats during the pause menu so we can't easily check in IngameState. I'm not sure but the original game might even crash when typing cheats on the main menu? There is probably an easy fix for this, but I don't know how to check wether we are ingame. The obvious solution for now is to not type cheats in the menus. I consider solving this crash beyond the scope.\r\n(I'm pretty sure the original game also crashed if player related cheats were entered but there wasn't a player character; so I didn't add a check for that either)","created_at":"2016-09-02T13:47:07Z","updated_at":"2016-09-03T18:00:49Z","closed_at":"2016-09-03T18:00:49Z","merged_at":"2016-09-03T18:00:49Z","merge_commit_sha":"243c3d7c4c80690ccb0f039896904fb4dca568c6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rwengine/openrw/pulls/232/commits","review_comments_url":"https://api.github.com/repos/rwengine/openrw/pulls/232/comments","review_comment_url":"https://api.github.com/repos/rwengine/openrw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rwengine/openrw/issues/232/comments","statuses_url":"https://api.github.com/repos/rwengine/openrw/statuses/70f777c685bf4d4b8b4e6449c7a6149e8ed0a747","head":{"label":"JayFoxRox:cheats","ref":"cheats","sha":"70f777c685bf4d4b8b4e6449c7a6149e8ed0a747","user":{"login":"JayFoxRox","id":360330,"avatar_url":"https://avatars.githubusercontent.com/u/360330?v=3","gravatar_id":"","url":"https://api.github.com/users/JayFoxRox","html_url":"https://github.com/JayFoxRox","followers_url":"https://api.github.com/users/JayFoxRox/followers","following_url":"https://api.github.com/users/JayFoxRox/following{/other_user}","gists_url":"https://api.github.com/users/JayFoxRox/gists{/gist_id}","starred_url":"https://api.github.com/users/JayFoxRox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayFoxRox/subscriptions","organizations_url":"https://api.github.com/users/JayFoxRox/orgs","repos_url":"https://api.github.com/users/JayFoxRox/repos","events_url":"https://api.github.com/users/JayFoxRox/events{/privacy}","received_events_url":"https://api.github.com/users/JayFoxRox/received_events","type":"User","site_admin":false},"repo":{"id":59780349,"name":"openrw","full_name":"JayFoxRox/openrw","owner":{"login":"JayFoxRox","id":360330,"avatar_url":"https://avatars.githubusercontent.com/u/360330?v=3","gravatar_id":"","url":"https://api.github.com/users/JayFoxRox","html_url":"https://github.com/JayFoxRox","followers_url":"https://api.github.com/users/JayFoxRox/followers","following_url":"https://api.github.com/users/JayFoxRox/following{/other_user}","gists_url":"https://api.github.com/users/JayFoxRox/gists{/gist_id}","starred_url":"https://api.github.com/users/JayFoxRox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayFoxRox/subscriptions","organizations_url":"https://api.github.com/users/JayFoxRox/orgs","repos_url":"https://api.github.com/users/JayFoxRox/repos","events_url":"https://api.github.com/users/JayFoxRox/events{/privacy}","received_events_url":"https://api.github.com/users/JayFoxRox/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JayFoxRox/openrw","description":"OpenRW \"Open ReWrite\" is an un-official open source recreation of the classic Grand Theft Auto III game executable","fork":true,"url":"https://api.github.com/repos/JayFoxRox/openrw","forks_url":"https://api.github.com/repos/JayFoxRox/openrw/forks","keys_url":"https://api.github.com/repos/JayFoxRox/openrw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JayFoxRox/openrw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JayFoxRox/openrw/teams","hooks_url":"https://api.github.com/repos/JayFoxRox/openrw/hooks","issue_events_url":"https://api.github.com/repos/JayFoxRox/openrw/issues/events{/number}","events_url":"https://api.github.com/repos/JayFoxRox/openrw/events","assignees_url":"https://api.github.com/repos/JayFoxRox/openrw/assignees{/user}","branches_url":"https://api.github.com/repos/JayFoxRox/openrw/branches{/branch}","tags_url":"https://api.github.com/repos/JayFoxRox/openrw/tags","blobs_url":"https://api.github.com/repos/JayFoxRox/openrw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JayFoxRox/openrw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JayFoxRox/openrw/git/refs{/sha}","trees_url":"https://api.github.com/repos/JayFoxRox/openrw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JayFoxRox/openrw/statuses/{sha}","languages_url":"https://api.github.com/repos/JayFoxRox/openrw/languages","stargazers_url":"https://api.github.com/repos/JayFoxRox/openrw/stargazers","contributors_url":"https://api.github.com/repos/JayFoxRox/openrw/contributors","subscribers_url":"https://api.github.com/repos/JayFoxRox/openrw/subscribers","subscription_url":"https://api.github.com/repos/JayFoxRox/openrw/subscription","commits_url":"https://api.github.com/repos/JayFoxRox/openrw/commits{/sha}","git_commits_url":"https://api.github.com/repos/JayFoxRox/openrw/git/commits{/sha}","comments_url":"https://api.github.com/repos/JayFoxRox/openrw/comments{/number}","issue_comment_url":"https://api.github.com/repos/JayFoxRox/openrw/issues/comments{/number}","contents_url":"https://api.github.com/repos/JayFoxRox/openrw/contents/{+path}","compare_url":"https://api.github.com/repos/JayFoxRox/openrw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JayFoxRox/openrw/merges","archive_url":"https://api.github.com/repos/JayFoxRox/openrw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JayFoxRox/openrw/downloads","issues_url":"https://api.github.com/repos/JayFoxRox/openrw/issues{/number}","pulls_url":"https://api.github.com/repos/JayFoxRox/openrw/pulls{/number}","milestones_url":"https://api.github.com/repos/JayFoxRox/openrw/milestones{/number}","notifications_url":"https://api.github.com/repos/JayFoxRox/openrw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JayFoxRox/openrw/labels{/name}","releases_url":"https://api.github.com/repos/JayFoxRox/openrw/releases{/id}","deployments_url":"https://api.github.com/repos/JayFoxRox/openrw/deployments","created_at":"2016-05-26T20:12:18Z","updated_at":"2016-06-05T18:08:29Z","pushed_at":"2016-09-02T13:35:43Z","git_url":"git://github.com/JayFoxRox/openrw.git","ssh_url":"git@github.com:JayFoxRox/openrw.git","clone_url":"https://github.com/JayFoxRox/openrw.git","svn_url":"https://github.com/JayFoxRox/openrw","homepage":"https://github.com/rwengine/openrw","size":2190,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"rwengine:master","ref":"master","sha":"92b7f922b427d373b925e9f97241f7ee72a7ea5c","user":{"login":"rwengine","id":19520421,"avatar_url":"https://avatars.githubusercontent.com/u/19520421?v=3","gravatar_id":"","url":"https://api.github.com/users/rwengine","html_url":"https://github.com/rwengine","followers_url":"https://api.github.com/users/rwengine/followers","following_url":"https://api.github.com/users/rwengine/following{/other_user}","gists_url":"https://api.github.com/users/rwengine/gists{/gist_id}","starred_url":"https://api.github.com/users/rwengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwengine/subscriptions","organizations_url":"https://api.github.com/users/rwengine/orgs","repos_url":"https://api.github.com/users/rwengine/repos","events_url":"https://api.github.com/users/rwengine/events{/privacy}","received_events_url":"https://api.github.com/users/rwengine/received_events","type":"Organization","site_admin":false},"repo":{"id":34529275,"name":"openrw","full_name":"rwengine/openrw","owner":{"login":"rwengine","id":19520421,"avatar_url":"https://avatars.githubusercontent.com/u/19520421?v=3","gravatar_id":"","url":"https://api.github.com/users/rwengine","html_url":"https://github.com/rwengine","followers_url":"https://api.github.com/users/rwengine/followers","following_url":"https://api.github.com/users/rwengine/following{/other_user}","gists_url":"https://api.github.com/users/rwengine/gists{/gist_id}","starred_url":"https://api.github.com/users/rwengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwengine/subscriptions","organizations_url":"https://api.github.com/users/rwengine/orgs","repos_url":"https://api.github.com/users/rwengine/repos","events_url":"https://api.github.com/users/rwengine/events{/privacy}","received_events_url":"https://api.github.com/users/rwengine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rwengine/openrw","description":"OpenRW \"Open ReWrite\" is an un-official open source recreation of the classic Grand Theft Auto III game executable","fork":false,"url":"https://api.github.com/repos/rwengine/openrw","forks_url":"https://api.github.com/repos/rwengine/openrw/forks","keys_url":"https://api.github.com/repos/rwengine/openrw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwengine/openrw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwengine/openrw/teams","hooks_url":"https://api.github.com/repos/rwengine/openrw/hooks","issue_events_url":"https://api.github.com/repos/rwengine/openrw/issues/events{/number}","events_url":"https://api.github.com/repos/rwengine/openrw/events","assignees_url":"https://api.github.com/repos/rwengine/openrw/assignees{/user}","branches_url":"https://api.github.com/repos/rwengine/openrw/branches{/branch}","tags_url":"https://api.github.com/repos/rwengine/openrw/tags","blobs_url":"https://api.github.com/repos/rwengine/openrw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwengine/openrw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwengine/openrw/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwengine/openrw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwengine/openrw/statuses/{sha}","languages_url":"https://api.github.com/repos/rwengine/openrw/languages","stargazers_url":"https://api.github.com/repos/rwengine/openrw/stargazers","contributors_url":"https://api.github.com/repos/rwengine/openrw/contributors","subscribers_url":"https://api.github.com/repos/rwengine/openrw/subscribers","subscription_url":"https://api.github.com/repos/rwengine/openrw/subscription","commits_url":"https://api.github.com/repos/rwengine/openrw/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwengine/openrw/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwengine/openrw/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwengine/openrw/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwengine/openrw/contents/{+path}","compare_url":"https://api.github.com/repos/rwengine/openrw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwengine/openrw/merges","archive_url":"https://api.github.com/repos/rwengine/openrw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwengine/openrw/downloads","issues_url":"https://api.github.com/repos/rwengine/openrw/issues{/number}","pulls_url":"https://api.github.com/repos/rwengine/openrw/pulls{/number}","milestones_url":"https://api.github.com/repos/rwengine/openrw/milestones{/number}","notifications_url":"https://api.github.com/repos/rwengine/openrw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwengine/openrw/labels{/name}","releases_url":"https://api.github.com/repos/rwengine/openrw/releases{/id}","deployments_url":"https://api.github.com/repos/rwengine/openrw/deployments","created_at":"2015-04-24T16:26:12Z","updated_at":"2016-09-03T10:18:38Z","pushed_at":"2016-09-03T18:00:50Z","git_url":"git://github.com/rwengine/openrw.git","ssh_url":"git@github.com:rwengine/openrw.git","clone_url":"https://github.com/rwengine/openrw.git","svn_url":"https://github.com/rwengine/openrw","homepage":"https://github.com/rwengine/openrw","size":2355,"stargazers_count":318,"watchers_count":318,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":58,"forks":37,"open_issues":58,"watchers":318,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rwengine/openrw/pulls/232"},"html":{"href":"https://github.com/rwengine/openrw/pull/232"},"issue":{"href":"https://api.github.com/repos/rwengine/openrw/issues/232"},"comments":{"href":"https://api.github.com/repos/rwengine/openrw/issues/232/comments"},"review_comments":{"href":"https://api.github.com/repos/rwengine/openrw/pulls/232/comments"},"review_comment":{"href":"https://api.github.com/repos/rwengine/openrw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rwengine/openrw/pulls/232/commits"},"statuses":{"href":"https://api.github.com/repos/rwengine/openrw/statuses/70f777c685bf4d4b8b4e6449c7a6149e8ed0a747"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"danhedron","id":418211,"avatar_url":"https://avatars.githubusercontent.com/u/418211?v=3","gravatar_id":"","url":"https://api.github.com/users/danhedron","html_url":"https://github.com/danhedron","followers_url":"https://api.github.com/users/danhedron/followers","following_url":"https://api.github.com/users/danhedron/following{/other_user}","gists_url":"https://api.github.com/users/danhedron/gists{/gist_id}","starred_url":"https://api.github.com/users/danhedron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danhedron/subscriptions","organizations_url":"https://api.github.com/users/danhedron/orgs","repos_url":"https://api.github.com/users/danhedron/repos","events_url":"https://api.github.com/users/danhedron/events{/privacy}","received_events_url":"https://api.github.com/users/danhedron/received_events","type":"User","site_admin":false},"comments":3,"review_comments":2,"commits":3,"additions":276,"deletions":59,"changed_files":6}}
{"actor":{"display_login":"danhedron"}}