Skip to content

Commit

Permalink
UPDATE filename when saving map (fixes mapedit titlebar display)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksterker committed May 9, 2011
1 parent bdf6864 commit 62f28a6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/world/area.cc
Expand Up @@ -522,18 +522,20 @@ bool area::get_state (base::flat & file)
}

// save to file
bool area::save (const std::string & fname, const base::diskio::file_format & format) const
bool area::save (const std::string & fname, const base::diskio::file_format & format)
{
// try to save map
base::diskio record (format);
if (!put_state (record))

// try to save map to disk
if (put_state (record) &&
record.put_record (fname))
{
fprintf (stderr, "*** area::save: saving '%s' failed!\n", fname.c_str ());
return false;
Filename = fname;
return true;
}

// write map to disk
return record.put_record (fname);
LOG(ERROR) << "*** area::save: saving '" << fname << "' failed!";
return false;
}

// load from file
Expand Down

0 comments on commit 62f28a6

Please sign in to comment.