]> git.pond.sub.org Git - empserver/commitdiff
Fix empdump not to truncate game state files with fixed size
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 May 2011 20:27:26 +0000 (22:27 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Jun 2011 14:50:06 +0000 (16:50 +0200)
empdump -i now complains about missing rows instead of silently
truncating the file to a size the server will reject.  Affects tables
sector, nation, realms, game.

src/lib/common/xundump.c

index fb6ea7ad5da5de9c460cc11edb3b962731726b5d..97a3eed1b3a1e4b0649a253c51ca274c430b213d 100644 (file)
@@ -995,8 +995,9 @@ xubody(FILE *fp)
     if (CANT_HAPPEN(maxid > ep->fids))
        maxid = ep->fids;
     if (maxid < ep->fids) {
-       if (EF_IS_GAME_STATE(cur_type)
-           || (cur_type >= EF_SHIP_CHR && cur_type <= EF_NUKE_CHR)) {
+       if (ep->nent < 0
+           && (EF_IS_GAME_STATE(cur_type)
+               || (cur_type >= EF_SHIP_CHR && cur_type <= EF_NUKE_CHR))) {
            if (!ef_truncate(cur_type, maxid))
                return -1;
        } else