Normalise spelling of "levelled" throughout the code

This commit is contained in:
scrawl 2015-02-01 00:26:06 +01:00
parent 0c6e2170db
commit 6d097fbfbd
7 changed files with 23 additions and 23 deletions

View file

@ -837,7 +837,7 @@ void Record<ESM::CreatureLevList>::print()
std::cout << " Chance for None: " << (int)mData.mChanceNone << std::endl; std::cout << " Chance for None: " << (int)mData.mChanceNone << std::endl;
std::cout << " Flags: " << creatureListFlags(mData.mFlags) << std::endl; std::cout << " Flags: " << creatureListFlags(mData.mFlags) << std::endl;
std::cout << " Number of items: " << mData.mList.size() << std::endl; std::cout << " Number of items: " << mData.mList.size() << std::endl;
std::vector<ESM::LeveledListBase::LevelItem>::iterator iit; std::vector<ESM::LevelledListBase::LevelItem>::iterator iit;
for (iit = mData.mList.begin(); iit != mData.mList.end(); ++iit) for (iit = mData.mList.begin(); iit != mData.mList.end(); ++iit)
std::cout << " Creature: Level: " << iit->mLevel std::cout << " Creature: Level: " << iit->mLevel
<< " Creature: " << iit->mId << std::endl; << " Creature: " << iit->mId << std::endl;
@ -849,7 +849,7 @@ void Record<ESM::ItemLevList>::print()
std::cout << " Chance for None: " << (int)mData.mChanceNone << std::endl; std::cout << " Chance for None: " << (int)mData.mChanceNone << std::endl;
std::cout << " Flags: " << itemListFlags(mData.mFlags) << std::endl; std::cout << " Flags: " << itemListFlags(mData.mFlags) << std::endl;
std::cout << " Number of items: " << mData.mList.size() << std::endl; std::cout << " Number of items: " << mData.mList.size() << std::endl;
std::vector<ESM::LeveledListBase::LevelItem>::iterator iit; std::vector<ESM::LevelledListBase::LevelItem>::iterator iit;
for (iit = mData.mList.begin(); iit != mData.mList.end(); ++iit) for (iit = mData.mList.begin(); iit != mData.mList.end(); ++iit)
std::cout << " Inventory: Level: " << iit->mLevel std::cout << " Inventory: Level: " << iit->mLevel
<< " Item: " << iit->mId << std::endl; << " Item: " << iit->mId << std::endl;

View file

@ -22,7 +22,7 @@ namespace ESSImport
ActorData::load(esm); ActorData::load(esm);
if (esm.isNextSub("LVCR")) if (esm.isNextSub("LVCR"))
{ {
// occurs on leveled creature spawner references // occurs on levelled creature spawner references
// probably some identifier for the creature that has been spawned? // probably some identifier for the creature that has been spawned?
unsigned char lvcr; unsigned char lvcr;
esm.getHT(lvcr); esm.getHT(lvcr);
@ -32,7 +32,7 @@ namespace ESSImport
mEnabled = true; mEnabled = true;
esm.getHNOT(mEnabled, "ZNAM"); esm.getHNOT(mEnabled, "ZNAM");
// DATA should occur for all references, except leveled creature spawners // DATA should occur for all references, except levelled creature spawners
// I've seen DATA *twice* on a creature record, and with the exact same content too! weird // I've seen DATA *twice* on a creature record, and with the exact same content too! weird
// alarmvoi0000.ess // alarmvoi0000.ess
esm.getHNOT(mPos, "DATA", 24); esm.getHNOT(mPos, "DATA", 24);

View file

@ -12,9 +12,9 @@ namespace MWMechanics
{ {
/// @return ID of resulting item, or empty if none /// @return ID of resulting item, or empty if none
inline std::string getLevelledItem (const ESM::LeveledListBase* levItem, bool creature, unsigned char failChance=0) inline std::string getLevelledItem (const ESM::LevelledListBase* levItem, bool creature, unsigned char failChance=0)
{ {
const std::vector<ESM::LeveledListBase::LevelItem>& items = levItem->mList; const std::vector<ESM::LevelledListBase::LevelItem>& items = levItem->mList;
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr(); const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
int playerLevel = player.getClass().getCreatureStats(player).getLevel(); int playerLevel = player.getClass().getCreatureStats(player).getLevel();
@ -27,7 +27,7 @@ namespace MWMechanics
std::vector<std::string> candidates; std::vector<std::string> candidates;
int highestLevel = 0; int highestLevel = 0;
for (std::vector<ESM::LeveledListBase::LevelItem>::const_iterator it = items.begin(); it != items.end(); ++it) for (std::vector<ESM::LevelledListBase::LevelItem>::const_iterator it = items.begin(); it != items.end(); ++it)
{ {
if (it->mLevel > highestLevel && it->mLevel <= playerLevel) if (it->mLevel > highestLevel && it->mLevel <= playerLevel)
highestLevel = it->mLevel; highestLevel = it->mLevel;
@ -39,7 +39,7 @@ namespace MWMechanics
allLevels = levItem->mFlags & ESM::CreatureLevList::AllLevels; allLevels = levItem->mFlags & ESM::CreatureLevList::AllLevels;
std::pair<int, std::string> highest = std::make_pair(-1, ""); std::pair<int, std::string> highest = std::make_pair(-1, "");
for (std::vector<ESM::LeveledListBase::LevelItem>::const_iterator it = items.begin(); it != items.end(); ++it) for (std::vector<ESM::LevelledListBase::LevelItem>::const_iterator it = items.begin(); it != items.end(); ++it)
{ {
if (playerLevel >= it->mLevel if (playerLevel >= it->mLevel
&& (allLevels || it->mLevel == highestLevel)) && (allLevels || it->mLevel == highestLevel))

View file

@ -200,7 +200,7 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_,
if (value.getProgress()>=1) if (value.getProgress()>=1)
{ {
// skill leveled up // skill levelled up
increaseSkill(skillIndex, class_, false); increaseSkill(skillIndex, class_, false);
} }
} }

View file

@ -34,24 +34,24 @@
namespace namespace
{ {
void addToLevList(ESM::LeveledListBase* list, const std::string& itemId, int level) void addToLevList(ESM::LevelledListBase* list, const std::string& itemId, int level)
{ {
for (std::vector<ESM::LeveledListBase::LevelItem>::iterator it = list->mList.begin(); it != list->mList.end();) for (std::vector<ESM::LevelledListBase::LevelItem>::iterator it = list->mList.begin(); it != list->mList.end();)
{ {
if (it->mLevel == level && itemId == it->mId) if (it->mLevel == level && itemId == it->mId)
return; return;
} }
ESM::LeveledListBase::LevelItem item; ESM::LevelledListBase::LevelItem item;
item.mId = itemId; item.mId = itemId;
item.mLevel = level; item.mLevel = level;
list->mList.push_back(item); list->mList.push_back(item);
} }
void removeFromLevList(ESM::LeveledListBase* list, const std::string& itemId, int level) void removeFromLevList(ESM::LevelledListBase* list, const std::string& itemId, int level)
{ {
// level of -1 removes all items with that itemId // level of -1 removes all items with that itemId
for (std::vector<ESM::LeveledListBase::LevelItem>::iterator it = list->mList.begin(); it != list->mList.end();) for (std::vector<ESM::LevelledListBase::LevelItem>::iterator it = list->mList.begin(); it != list->mList.end();)
{ {
if (level != -1 && it->mLevel != level) if (level != -1 && it->mLevel != level)
{ {

View file

@ -7,7 +7,7 @@
namespace ESM namespace ESM
{ {
void LeveledListBase::load(ESMReader &esm) void LevelledListBase::load(ESMReader &esm)
{ {
esm.getHNT(mFlags, "DATA"); esm.getHNT(mFlags, "DATA");
esm.getHNT(mChanceNone, "NNAM"); esm.getHNT(mChanceNone, "NNAM");
@ -34,7 +34,7 @@ void LeveledListBase::load(ESMReader &esm)
esm.getHNT(li.mLevel, "INTV"); esm.getHNT(li.mLevel, "INTV");
} }
} }
void LeveledListBase::save(ESMWriter &esm) const void LevelledListBase::save(ESMWriter &esm) const
{ {
esm.writeHNT("DATA", mFlags); esm.writeHNT("DATA", mFlags);
esm.writeHNT("NNAM", mChanceNone); esm.writeHNT("NNAM", mChanceNone);
@ -47,7 +47,7 @@ void LeveledListBase::save(ESMWriter &esm) const
} }
} }
void LeveledListBase::blank() void LevelledListBase::blank()
{ {
mFlags = 0; mFlags = 0;
mChanceNone = 0; mChanceNone = 0;

View file

@ -11,14 +11,14 @@ class ESMReader;
class ESMWriter; class ESMWriter;
/* /*
* Leveled lists. Since these have identical layout, I only bothered * Levelled lists. Since these have identical layout, I only bothered
* to implement it once. * to implement it once.
* *
* We should later implement the ability to merge leveled lists from * We should later implement the ability to merge levelled lists from
* several files. * several files.
*/ */
struct LeveledListBase struct LevelledListBase
{ {
int mFlags; int mFlags;
unsigned char mChanceNone; // Chance that none are selected (0-100) unsigned char mChanceNone; // Chance that none are selected (0-100)
@ -43,7 +43,7 @@ struct LeveledListBase
///< Set record to default state (does not touch the ID). ///< Set record to default state (does not touch the ID).
}; };
struct CreatureLevList: LeveledListBase struct CreatureLevList: LevelledListBase
{ {
static unsigned int sRecordId; static unsigned int sRecordId;
@ -61,7 +61,7 @@ struct CreatureLevList: LeveledListBase
} }
}; };
struct ItemLevList: LeveledListBase struct ItemLevList: LevelledListBase
{ {
static unsigned int sRecordId; static unsigned int sRecordId;
@ -72,7 +72,7 @@ struct ItemLevList: LeveledListBase
// list is instantiated, instead of // list is instantiated, instead of
// giving several identical items // giving several identical items
// (used when a container has more // (used when a container has more
// than one instance of one leveled // than one instance of one levelled
// list.) // list.)
AllLevels = 0x02 // Calculate from all levels <= player AllLevels = 0x02 // Calculate from all levels <= player
// level, not just the closest below // level, not just the closest below