Implement xundump table truncation

This commit is contained in:
Markus Armbruster 2008-02-26 21:19:26 +01:00
parent cf16c74a3d
commit 6af2ad7c56

View file

@ -986,12 +986,9 @@ xubody(FILE *fp)
if (CANT_HAPPEN(maxid > ep->fids)) if (CANT_HAPPEN(maxid > ep->fids))
maxid = ep->fids; maxid = ep->fids;
if (maxid < ep->fids) { if (maxid < ep->fids) {
if (EF_IS_GAME_STATE(cur_type) && maxid != ep->csize) if (EF_IS_GAME_STATE(cur_type)
/* TODO truncate file */ || (cur_type >= EF_SHIP_CHR && cur_type <= EF_NUKE_CHR))
gripe("Warning: should resize table %s from %d to %d, not implemented", ef_truncate(cur_type, maxid);
ef_nameof(cur_type), ep->csize, maxid);
else if (cur_type >= EF_SHIP_CHR && cur_type <= EF_NUKE_CHR)
ep->cids = ep->fids = maxid;
else else
return gripe("Table %s requires %d rows, got %d", return gripe("Table %s requires %d rows, got %d",
ef_nameof(cur_type), ep->fids, maxid); ef_nameof(cur_type), ep->fids, maxid);