From 69cd15f050cdef9f4f82bd4d9ff2f54dd37c87d1 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Tue, 27 Oct 2009 03:40:45 +0100 Subject: Move exclusion marshalling code to exclude.cc. --- crawl-ref/source/travel.cc | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'crawl-ref/source/travel.cc') diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 14eb85f72d..079b4a877d 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -3314,17 +3314,7 @@ void LevelInfo::save(writer& outf) const } } - marshallShort(outf, excludes.size()); - if (excludes.size()) - { - for (int i = 0, count = excludes.size(); i < count; ++i) - { - marshallCoord(outf, excludes[i].pos); - marshallShort(outf, excludes[i].radius); - marshallBoolean(outf, excludes[i].autoex); - marshallShort(outf, excludes[i].mon); - } - } + marshallExcludes(outf, excludes); } void LevelInfo::load(reader& inf, char minorVersion) @@ -3354,25 +3344,7 @@ void LevelInfo::load(reader& inf, char minorVersion) stair_distances.push_back( unmarshallShort(inf) ); } - excludes.clear(); - int nexcludes = unmarshallShort(inf); - if (nexcludes) - { - for (int i = 0; i < nexcludes; ++i) - { - coord_def c; - unmarshallCoord(inf, c); - const int radius = unmarshallShort(inf); - bool autoexcl = false; - monster_type mon = MONS_NO_MONSTER; - if (minorVersion >= TAG_ANNOTATE_EXCL) - { - autoexcl = unmarshallBoolean(inf); - mon = static_cast(unmarshallShort(inf)); - } - excludes.push_back(travel_exclude(c, radius, autoexcl, mon)); - } - } + unmarshallExcludes(inf, minorVersion, excludes); } void LevelInfo::fixup() -- cgit v1.2.3-54-g00ecf