{"action":"created","issue":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/2048","labels_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/2048/labels{/name}","comments_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/2048/comments","events_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/2048/events","html_url":"https://github.com/OpenRCT2/OpenRCT2/pull/2048","id":110791155,"number":2048,"title":"Clean up sub_6960AB function (peep_should_go_on_ride)","user":{"login":"clamburger","id":1396298,"avatar_url":"https://avatars.githubusercontent.com/u/1396298?v=3","gravatar_id":"","url":"https://api.github.com/users/clamburger","html_url":"https://github.com/clamburger","followers_url":"https://api.github.com/users/clamburger/followers","following_url":"https://api.github.com/users/clamburger/following{/other_user}","gists_url":"https://api.github.com/users/clamburger/gists{/gist_id}","starred_url":"https://api.github.com/users/clamburger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clamburger/subscriptions","organizations_url":"https://api.github.com/users/clamburger/orgs","repos_url":"https://api.github.com/users/clamburger/repos","events_url":"https://api.github.com/users/clamburger/events{/privacy}","received_events_url":"https://api.github.com/users/clamburger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-10T12:05:57Z","updated_at":"2015-10-10T16:53:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/2048","html_url":"https://github.com/OpenRCT2/OpenRCT2/pull/2048","diff_url":"https://github.com/OpenRCT2/OpenRCT2/pull/2048.diff","patch_url":"https://github.com/OpenRCT2/OpenRCT2/pull/2048.patch"},"body":"These changes primarily cleans up the sub_6960AB function, which is used whenever a peep needs to decide whether or not they should go on a ride or visit a shop.\r\n\r\nMy C is a little rusty, so let me know if something needs to be changed or if either of the changes to original behaviour should be reversed.\r\n\r\nBug fixes made in the process:\r\n* If it was raining and a peep goes on a ride that's sufficiently undercover, the peep would bypass all excitement and intensity checks (original game bug)\r\n* The \"Ride 1 is really good value\" thought was never able to be triggered due to an incorrect flag check.\r\n* The \"Ride 1 is really good value\" thought is no longer triggered if the peep paid for park entry. Previously, it checked if the park was currently free, even if it wasn't when the peep entered. Now the \"good value\" logic matches the \"bad value\" logic. (original game bug)\r\n* If a peep encountered a queue on their way to a different ride or shop, it would reset their destination even if they decided not to enter.\r\n* The min and max intensity values in peep_on_enter_ride were reversed.\r\n\r\nOther things identified:\r\n* `ride->first_peep_in_queue` seems to refer to the *latest* peep to enter the queue, but I wasn't sufficiently confident to change to the name. \r\n* `ride->var_114` seems to indicate how much of the ride is undercover (this affects if peeps will go on the ride while it's raining). I wasn't able to figure out exactly what contributed to it (being underground is one thing)"},"comment":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/comments/147106597","html_url":"https://github.com/OpenRCT2/OpenRCT2/pull/2048#issuecomment-147106597","issue_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/2048","id":147106597,"user":{"login":"clamburger","id":1396298,"avatar_url":"https://avatars.githubusercontent.com/u/1396298?v=3","gravatar_id":"","url":"https://api.github.com/users/clamburger","html_url":"https://github.com/clamburger","followers_url":"https://api.github.com/users/clamburger/followers","following_url":"https://api.github.com/users/clamburger/following{/other_user}","gists_url":"https://api.github.com/users/clamburger/gists{/gist_id}","starred_url":"https://api.github.com/users/clamburger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clamburger/subscriptions","organizations_url":"https://api.github.com/users/clamburger/orgs","repos_url":"https://api.github.com/users/clamburger/repos","events_url":"https://api.github.com/users/clamburger/events{/privacy}","received_events_url":"https://api.github.com/users/clamburger/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T16:53:01Z","updated_at":"2015-10-10T16:53:01Z","body":"Ah, I see now: the union containing inversions, holes and var_114 all refers to the same byte in memory, and the lower 5 bits are used for both inversions and holes (leaving the upper 3 bits for var_114). I'm still getting my head around how the memory is managed.\r\n\r\n"}}