ID:2567820
 
(See the best response by Lummox JR.)
Code:runtime error: list index out of bounds
proc name: onResize (/client/verb/onResize)
usr: Arcane Addict (/mob/pl)
src: Arcane Addict (/client)
usr.loc: the grass (1,1,1) (/turf/grass)
call stack:
Arcane Addict (/client): onResize("\[\[id]]", "\[\[size]]")

var
view_width
view_height
buffer_x
buffer_y
map_zoom
verb
onResize(map as text|null, size as text|null)
set hidden = 1
set instant = 1
var/list/sz = splittext(size,"x")
var/map_width = text2num(sz[1]), map_height = text2num(sz[2])
map_zoom = 1
view_width = ceil(map_width/TILE_WIDTH)
if(!(view_width%2)) ++view_width
view_height = ceil(map_height/TILE_HEIGHT)
if(!(view_height%2)) ++view_height
while(view_width*view_height>MAX_VIEW_TILES)
view_width = ceil(map_width/TILE_WIDTH/++map_zoom)
if(!(view_width%2)) ++view_width
view_height = ceil(map_height/TILE_HEIGHT/map_zoom)
if(!(view_height%2)) ++view_height
buffer_x = floor((view_width*TILE_WIDTH - map_width/map_zoom)/2)
buffer_y = floor((view_height*TILE_HEIGHT - map_height/map_zoom)/2)
src.view = "[view_width]x[view_height]"
//winset(src,map,"zoom=[map_zoom];")
proc
InitView()
set waitfor = 0
var/list/l = params2list(winget(src,":map","id;size;"))
onResize(l["id"],l["size"])




Post the code for client.onResize().
Best response
You need to edit your posts to put the code inside of <dm>...</dm> tags. Without those it's impossible to read. In your initial post you also have all your text inside the <b> tags that were only intended for headings, which is another problem for readability.
You have a problem here where map and size being passed to onResize() can be null or of improper format. That's not so bad by itself because those runtimes help indicate you have a problem with the code that calls this verb, but there is no reason to have "as text|null" in the parameters of onResize(). Why is it a verb?

You may want to post any code that calls InitView() or onResize() inside DM tags as suggested by Lummox.
edited.