{"action":"closed","issue":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/1922","labels_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/1922/labels{/name}","comments_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/1922/comments","events_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/1922/events","html_url":"https://github.com/OpenRCT2/OpenRCT2/issues/1922","id":106083593,"number":1922,"title":"Arithmetic exception in viewport.c","user":{"login":"janisozaur","id":550290,"avatar_url":"https://avatars.githubusercontent.com/u/550290?v=3","gravatar_id":"","url":"https://api.github.com/users/janisozaur","html_url":"https://github.com/janisozaur","followers_url":"https://api.github.com/users/janisozaur/followers","following_url":"https://api.github.com/users/janisozaur/following{/other_user}","gists_url":"https://api.github.com/users/janisozaur/gists{/gist_id}","starred_url":"https://api.github.com/users/janisozaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janisozaur/subscriptions","organizations_url":"https://api.github.com/users/janisozaur/orgs","repos_url":"https://api.github.com/users/janisozaur/repos","events_url":"https://api.github.com/users/janisozaur/events{/privacy}","received_events_url":"https://api.github.com/users/janisozaur/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/labels/bug","name":"bug","color":"EE3F46"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/milestones/2","html_url":"https://github.com/OpenRCT2/OpenRCT2/milestones/v0.0.3%20-%20second%20stable","labels_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/milestones/2/labels","id":1163353,"number":2,"title":"v0.0.3 - second stable","description":"This will be the second stable release of OpenRCT2.\r\nThe goal will be to have at least all code implemented with the exception of viewport_render and vehicle_update and peep_update.","creator":{"login":"IntelOrca","id":1482259,"avatar_url":"https://avatars.githubusercontent.com/u/1482259?v=3","gravatar_id":"","url":"https://api.github.com/users/IntelOrca","html_url":"https://github.com/IntelOrca","followers_url":"https://api.github.com/users/IntelOrca/followers","following_url":"https://api.github.com/users/IntelOrca/following{/other_user}","gists_url":"https://api.github.com/users/IntelOrca/gists{/gist_id}","starred_url":"https://api.github.com/users/IntelOrca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IntelOrca/subscriptions","organizations_url":"https://api.github.com/users/IntelOrca/orgs","repos_url":"https://api.github.com/users/IntelOrca/repos","events_url":"https://api.github.com/users/IntelOrca/events{/privacy}","received_events_url":"https://api.github.com/users/IntelOrca/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":148,"state":"open","created_at":"2015-06-13T20:51:03Z","updated_at":"2015-11-15T21:23:27Z","due_on":"2015-12-01T00:00:00Z","closed_at":null},"comments":20,"created_at":"2015-09-11T20:02:55Z","updated_at":"2015-11-15T21:23:27Z","closed_at":"2015-11-15T21:23:27Z","body":"When trying save from #1774 (wine 1.7.51, arch linux) and clicking randomly on peeps, using 94fe643 a crash can be triggerred in `viewport.c`\r\n\r\n```\r\nProgram received signal SIGFPE, Arithmetic exception.\r\n0x702e7632 in viewport_invalidate (viewport=0x1423598, left=12448, top=0, right=232, bottom=7)\r\n    at /home/janisozaur/workspace/OpenRCT2/src/interface/viewport.c:2599\r\n2599\t\t\tleft /= zoom;\r\n```\r\n\r\nStack trace available:\r\n```\r\n#0  0x702e7632 in viewport_invalidate (viewport=0x1423598, left=12448, top=0, right=232, bottom=7) at /home/janisozaur/workspace/OpenRCT2/src/interface/viewport.c:2599\r\n#1  0x7024a48a in map_invalidate_tile_under_zoom (x=12704, y=160, z0=112, z1=128, maxZoom=-1) at /home/janisozaur/workspace/OpenRCT2/src/world/map.c:4071\r\n#2  0x7024a4d8 in map_invalidate_tile (x=6496, y=6176, z0=112, z1=128) at /home/janisozaur/workspace/OpenRCT2/src/world/map.c:4083\r\n#3  0x70249619 in map_set_grass_length (x=6496, y=6176, mapElement=0xfe0bb8, length=6) at /home/janisozaur/workspace/OpenRCT2/src/world/map.c:3646\r\n#4  0x70249581 in map_update_grass_length (x=6496, y=6176, mapElement=0xfe0bb8) at /home/janisozaur/workspace/OpenRCT2/src/world/map.c:3623\r\n#5  0x702493b0 in map_update_tiles () at /home/janisozaur/workspace/OpenRCT2/src/world/map.c:3569\r\n#6  0x70205c4e in game_logic_update () at /home/janisozaur/workspace/OpenRCT2/src/game.c:348\r\n#7  0x70205a65 in game_update () at /home/janisozaur/workspace/OpenRCT2/src/game.c:273\r\n#8  0x7022ade7 in rct2_update_2 () at /home/janisozaur/workspace/OpenRCT2/src/rct2.c:384\r\n#9  0x7022a996 in rct2_update () at /home/janisozaur/workspace/OpenRCT2/src/rct2.c:221\r\n#10 0x703056ac in openrct2_loop () at /home/janisozaur/workspace/OpenRCT2/src/openrct2.c:396\r\n#11 0x70305124 in openrct2_launch () at /home/janisozaur/workspace/OpenRCT2/src/openrct2.c:269\r\n#12 0x70302b55 in StartOpenRCT (hInstance=0x400000, hPrevInstance=0x0, lpCmdLine=0x126155 \"\", nCmdShow=1) at /home/janisozaur/workspace/OpenRCT2/src/platform/windows.c:82\r\n```\r\n\r\nOther useful information:\r\n```\r\n(gdb) p viewport\r\n$1 = (rct_viewport *) 0x1423598\r\n(gdb) p *viewport\r\n$2 = {width = 234, height = 11, x = 230, y = 7, view_x = 224, view_y = 7, view_width = 232, view_height = 7, zoom = 212 '\\324', var_11 = 0 '\\000', flags = 7}\r\n(gdb) up 3\r\n#3  0x70249619 in map_set_grass_length (x=6496, y=6176, mapElement=0xfe0bb8, length=6) at /home/janisozaur/workspace/OpenRCT2/src/world/map.c:3646\r\n3646\t\tmap_invalidate_tile(x, y, z0, z1);\r\n(gdb) p *mapElement \r\n$3 = {type = 1 '\\001', flags = 128 '\\200', base_height = 14 '\\016', clearance_height = 14 '\\016', properties = {surface = {slope = 0 '\\000', terrain = 160 '\\240', grass_length = 6 '\\006', ownership = 32 ' '}, \r\n    path = {type = 0 '\\000', additions = 160 '\\240', edges = 6 '\\006', {addition_status = 32 ' ', ride_index = 32 ' '}}, track = {type = 0 '\\000', {{sequence = 160 '\\240', colour = 6 '\\006'}, maze_entry = 1696}, \r\n      ride_index = 32 ' '}, scenery = {type = 0 '\\000', age = 160 '\\240', colour_1 = 6 '\\006', colour_2 = 32 ' '}, entrance = {type = 0 '\\000', index = 160 '\\240', path_type = 6 '\\006', ride_index = 32 ' '}, \r\n    fence = {type = 0 '\\000', item = \"\\240\\006 \"}, scenerymultiple = {type = 40960, colour = \"\\006 \"}, banner = {index = 0 '\\000', position = 160 '\\240', flags = 6 '\\006', unused = 32 ' '}}}\r\n```\r\n"}}