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