Got a really weird bug that I just can't figure out. I've traced it back to this bit of code:
If ButtonHit = Button[13] `OK for new map
ButtonHit=0
GetWidth = Val(GetEditBoxText(GenericConsoleEditBoxID[1]))
GetHeight = Val(GetEditBoxText(GenericConsoleEditBoxID[2]))
If GetWidth > 0 and GetHeight >0 ` The user has added values into both the width and height boxes so we're good
MapWidthInTiles = GetWidth
MapHeightInTiles = GetHeight
CalcMapEditGridSize() // Recalculate the size of the edit grid
CurrentMapName$="New Map"
Dim Map[MapWidthInTiles,MapHeightInTiles] As MapType
ZeroMapTypeArray(MapWidthInTiles,MapHeightInTiles,1)
DrawMapEditScreen() // Re-draw the map editor GUI as the checker grid might need changing
Accepted=1
Endif
Endif
Basically I can enter any value into the edit box and it works fine...apart from 10 and 5.... If I hard code those into the Dim command it works fine so I have to assume that the GetWidth or GetHeight variables are not transferring the number correctly. But it just seems utterly weird that it only causes an issue when I use 10 and 5. I can enter 5 and 10 no issues, 10 and 4, 10 and 6, 9 and 5 etc..Just not 10 and 5.
Any clues?!?!