diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2016-12-20 12:41:28 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2016-12-20 12:41:28 +0100 |
commit | e36571c70ca3abb639ef64bf6f5c924ca19e4ffa (patch) | |
tree | 3d28e63c8710477c3314f2bb9ba44bf3942b463a /src/main.c | |
parent | 30330c305545e1b93acd2ec7b72df7673bde9181 (diff) |
Implement map postprocessing fully.
Postprocessing removes info_* and team_* entities from all maps but the master (the first one in the command line) and (optionally) prefixes all targets and targetnames with a prefix (set by mapcat_prefix in the master worldspawn).
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -108,7 +108,7 @@ int main(int argc, char **argv) map_init(&map); - elist_for (input, inputs, list) { + elist_for(input, inputs, list) { map_t part; map_init(&part); @@ -121,6 +121,13 @@ int main(int argc, char **argv) if (!quiet) map_print_stats(input->path, &part); + // team_* and info_* ents are kept only in the first part + if (map_postprocess(&part, (input != inputs))) { + map_free(&map); + map_free(&part); + goto out; + } + if (map_merge(&map, &part)) { error("error: couldn't merge %s into %s\n", input->path, output); |