mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 00:45:34 +00:00
Fix hardcoded race IDs
This commit is contained in:
parent
eeb60edb65
commit
46d8f3ce5a
1 changed files with 6 additions and 9 deletions
|
@ -940,19 +940,16 @@ namespace MWWorld
|
|||
|
||||
if (Misc::StringUtils::ciEqual(record.mId, "player"))
|
||||
{
|
||||
static const char *sRaces[] =
|
||||
{
|
||||
"Argonian", "Breton", "Dark Elf", "High Elf", "Imperial", "Khajiit", "Nord", "Orc", "Redguard",
|
||||
"Woodelf", 0
|
||||
};
|
||||
std::vector<std::string> ids;
|
||||
getStore().get<ESM::Race>().listIdentifier(ids);
|
||||
|
||||
int i=0;
|
||||
unsigned int i=0;
|
||||
|
||||
for (; sRaces[i]; ++i)
|
||||
if (Misc::StringUtils::ciEqual (sRaces[i], record.mRace))
|
||||
for (; i<ids.size(); ++i)
|
||||
if (Misc::StringUtils::ciEqual (ids[i], record.mRace))
|
||||
break;
|
||||
|
||||
mGlobalVariables->setInt ("pcrace", sRaces[i] ? i+1 : 0);
|
||||
mGlobalVariables->setInt ("pcrace", (i == ids.size()) ? 0 : i+1);
|
||||
|
||||
const ESM::NPC *player =
|
||||
mPlayer->getPlayer().get<ESM::NPC>()->mBase;
|
||||
|
|
Loading…
Reference in a new issue