ID:149143
 
I have a proc that I made to place some text on the map and another proc to place a background there first to go behind the map. The background proc works fine for everything except one place. It does not show the top line of tiles for the background. This is the proc for displaying the background:

mob/proc/menu_back(var/x1,var/y1,var/x2,var/y2) for(var/xx=x1,xx<=x2,xx++)
for(var/yy=y1,yy<=y2,yy++)
var/obj/menu/M=new(client)
if(xx==x1)M.icon_state="l"//these if statements are to deturmine if itis on the edge of the background and if so change it to the edge icon_state
if(xx==x2)M.icon_state="r"
if(yy==y1)M.icon_state="b"
if(yy==y2)M.icon_state="t"
if(xx==x1&&yy==y1)M.icon_state="ll"
if(xx==x2&&yy==y2)M.icon_state="ur"
if(xx==x1&&yy==y2)M.icon_state="ul"
if(xx==x2&&yy==y1)M.icon_state="lr"
M.screen_loc="[xx],[yy]"

And this is the spot that calls the background proc that isnt functioning the way I want it to:

mob/proc/spell()
var/sply=12
if(length(ospl)==0)
menu_back(2,2,12,6)
map_text(2.5,11,6,2.5,"You do not know any spells.")
else
menu_back(6,12-(length(ospl)/2),12,12)
for(var/S in ospl)
text_speed=0
map_text(7.5,12,sply,sply,"[S]")
text_speed=1
sply-=0.5
pointer=new(client)
pointer.screen_loc="7,12"

When this calls the background proc the entire top of the background is not there (row 12 on the client.screen).

If anyone can point out to me what the problem is it would be appreciated.

[Edit]I noticed the problem. Sometimes it uses a decimal number in the third arg of the line:
menu_back(6,12-(length(ospl)/2),12,12) , so I used round to fix that. (I forgot to put the menu's New() proc, which if you had of seen you would have known why it needs to be a whole number.)
i see and u have a point and that code is right from my exp so just do wut u were doing.......
In response to Elven_Hero
What? Could you please explain yourself?
In response to Loduwijk
okay someone hacked me and did that! but here is wut i have to say.... (it'll be funny) the problem is that ur fly is down and ur mom is screaming at ppl and that the moon will implode and the birds and the knee's killed each other and the shinless man killed me....sorry i had to do that if u have a complaint just say...I"m a hot dog on a bun!
In response to Elven_Hero
Funny, but I was actually looking for something that helped solve my proc problem. :)