Split *Options::FromString into FromString and FromOneModString.

Check for invalid mod names when loading a course by checking whether the mod is a valid PlayerOption or a valid SongOption.  Previously, SongOption mods were being flagged as errors by PlayerOptions.
This commit is contained in:
Chris Danford
2007-08-20 02:57:05 +00:00
parent e2d8d6d718
commit 4311158735
9 changed files with 265 additions and 226 deletions
+3 -3
View File
@@ -13,6 +13,7 @@
#include "RageFileManager.h"
#include "CourseWriterCRS.h"
#include "RageUtil.h"
#include "CourseUtil.h"
#include <float.h>
const int MAX_EDIT_COURSE_SIZE_BYTES = 30*1024; // 30KB
@@ -130,9 +131,8 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
attack.fSecsRemaining = 0.0f;
}
// warn on invalid so we catch bogus mods on load
PlayerOptions po;
po.FromString( attack.sModifiers, true );
// warn on invalid so we catch typos on load
CourseUtil::WarnOnInvalidMods( attack.sModifiers );
attacks.push_back( attack );
}