From 87d8922207406ddbad8495a566ef8b6553af7971 Mon Sep 17 00:00:00 2001 From: "wagic.jeck" Date: Sun, 13 Dec 2009 15:03:56 +0000 Subject: [PATCH] Jeck - quick fix to r1496. --- projects/mtg/src/GameOptions.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/projects/mtg/src/GameOptions.cpp b/projects/mtg/src/GameOptions.cpp index a4074a629..fe585e028 100644 --- a/projects/mtg/src/GameOptions.cpp +++ b/projects/mtg/src/GameOptions.cpp @@ -67,11 +67,14 @@ int Options::getID(string name){ } //Is it an unlocked set? - string setname = name.substr(strlen("unlocked_")); - if(setlist.size()){ - int unlocked = setlist[setname]; - if(unlocked != -1) - return Options::optionSet(unlocked); + size_t un = strlen("unlocked_"); + if(un < name.size()){ + string setname = name.substr(un); + if(setlist.size()){ + int unlocked = setlist[setname]; + if(unlocked != -1) + return Options::optionSet(unlocked); + } } //Failure.