DMM Suite

by IainPeregrine
The DMM Suite provides saving and loading of map files in BYOND's native DMM map format.
ID:1261358
 
Resolved
Maps containing only one key generated runtime errors.
Applies to:DM Language
Status: Resolved (2.0)

This issue has been resolved.
There is a bug with this lib where maps will fail to save if the entire map is only a single type of turf. This is what the error looks like.

runtime error: log(52,0) is not computable
verb name: write map (/dmm_suite/write_map)
source file: writer.dm,68
usr: SuperAntx (/mob)
src: /dmm_suite (/dmm_suite)
call stack:
/dmm_suite (/dmm_suite): write map(the turf (1,1,1) (/turf), the turf (7,7,8) (/turf), 16)
/dmm_suite (/dmm_suite): save map(the turf (1,1,1) (/turf), the turf (7,7,8) (/turf), "savedmap", 16)
SuperAntx (/mob): save("savedmap")


There's a very simple fix. Change line 68 of write.dm to the code provided.

//Bugged
var/key_length = round/*floor*/(log(letter_digits.len,templates.len-1)+1)

//Fixed
var/key_length = 1
if(templates.len > 1)key_length = round/*floor*/(log(letter_digits.len,templates.len-1)+1)
I added you as a contributor. You should be able to update the zip file. Or, take the entire thing and host it as your own library: SuperAntx.dmm_suite
IainPeregrine resolved issue with message:
Maps containing only one key generated runtime errors.