Skip to content

ObjectTranslator doesn't perfectly roundtrip w3a files #81

@Slayer95

Description

@Slayer95

Test script:

"use strict";

const fs = require('fs');
const {ObjectsTranslator} = require('wc3maptranslator');

function parseAbilities(filePath) {
  return ObjectsTranslator.warToJson('abilities', fs.readFileSync(filePath));
}

function exportAbilities(filePath, data) {
  fs.writeFileSync(filePath, ObjectsTranslator.jsonToWar('abilities', data).buffer);
}

const abilities = parseAbilities('war3map.w3a');
if (abilities.errors.length) throw new Error(`Errors found: ${abilities.errors.join(', ')}`)
exportAbilities('war3map-rt.w3a', abilities.json);

In the attached files, you can verify that war3map-rt.w3a has added a bunch of extraneous FourCC codes where there used to be a quad of zeroes.

w3a-test.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions