mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-20 16:08:44 +00:00
Changed: #1304: Checks in the mission compiler if the do_mission objective is correct (for a guild mission) when we add a number (the number of members from the guild needed to complete the mission) after a mission name
--HG-- branch : gsoc2011-guildmissions
This commit is contained in:
parent
9f05d66a81
commit
78dbefb759
1 changed files with 13 additions and 0 deletions
|
@ -3153,9 +3153,12 @@ class CContentMission: public CContentObjective
|
|||
}
|
||||
|
||||
public:
|
||||
CContentMission(): _Prim(0) {}
|
||||
|
||||
void init(CMissionData &md, IPrimitive *prim)
|
||||
{
|
||||
_Missions = md.getPropertyArray(prim, "mission_names", true, false);
|
||||
_Prim = prim;
|
||||
|
||||
CContentObjective::init(md, prim);
|
||||
}
|
||||
|
@ -3172,6 +3175,14 @@ public:
|
|||
ret += _Missions[i];
|
||||
if (i < _Missions.size()-1)
|
||||
ret += "; ";
|
||||
|
||||
// We check to see if we specified a number after the mission name. If so, we check if it's a guild mission
|
||||
std::size_t pos = _Missions[i].find_first_of(" \t");
|
||||
if (pos != std::string::npos && !md.isGuildMission())
|
||||
{
|
||||
string err = toString("primitive(%s): CContentMission: Number of members needed to complete the mission specified but the mission is not a guild mission.", _Prim->getName().c_str());
|
||||
throw EParseException(_Prim, err.c_str());
|
||||
}
|
||||
}
|
||||
// Add the 'nb_guild_members_needed' parameter if needed
|
||||
//ret += CContentObjective::genNbGuildMembersNeededOption(md);
|
||||
|
@ -3179,6 +3190,8 @@ public:
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
IPrimitive *_Prim;
|
||||
};
|
||||
REGISTER_STEP_CONTENT(CContentMission, "do_mission");
|
||||
|
||||
|
|
Loading…
Reference in a new issue