Extend CCL support with a chunk for storing the author's name
This commit is contained in:
parent
6bce30545d
commit
6de69604d9
@ -391,6 +391,10 @@ function parse_level(bytes, number) {
|
|||||||
// Password, but not encoded
|
// Password, but not encoded
|
||||||
// TODO ???
|
// 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) {
|
else if (field_type === 0x0a) {
|
||||||
// Initial actor order
|
// Initial actor order
|
||||||
// TODO ??? should i... trust this...
|
// TODO ??? should i... trust this...
|
||||||
@ -639,6 +643,10 @@ export function synthesize_level(stored_level) {
|
|||||||
if (hint_text !== null) {
|
if (hint_text !== null) {
|
||||||
add_block(7, util.bytestring_to_buffer(hint_text.substring(0, 127) + "\0"));
|
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)
|
// Monster positions (dumb as hell and only used in MS mode)
|
||||||
if (monster_coords.length > 0) {
|
if (monster_coords.length > 0) {
|
||||||
if (monster_coords.length > 256) {
|
if (monster_coords.length > 256) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user