Extend CCL support with a chunk for storing the author's name

This commit is contained in:
Eevee (Evelyn Woods) 2021-05-25 17:27:41 -06:00
parent 6bce30545d
commit 6de69604d9

View File

@ -391,6 +391,10 @@ function parse_level(bytes, number) {
// Password, but not encoded
// TODO ???
}
else if (field_type === 0x09) {
// EXTENSION: Author, including trailing NUL
level.author = util.string_from_buffer_ascii(bytes, p, field_length - 1);
}
else if (field_type === 0x0a) {
// Initial actor order
// TODO ??? should i... trust this...
@ -639,6 +643,10 @@ export function synthesize_level(stored_level) {
if (hint_text !== null) {
add_block(7, util.bytestring_to_buffer(hint_text.substring(0, 127) + "\0"));
}
// EXTENSION: Author's name, if present
if (stored_level.author) {
add_block(9, util.bytestring_to_buffer(stored_level.author.substring(0, 255) + "\0"));
}
// Monster positions (dumb as hell and only used in MS mode)
if (monster_coords.length > 0) {
if (monster_coords.length > 256) {