Issue #474: adjust global variable pcrace

actorid
Marc Zinnschlag 12 years ago
parent 3db850a7d1
commit 8e1a2e3a13

@ -203,6 +203,8 @@ namespace MWWorld
mGlobalVariables->setInt ("chargenstate", 1);
}
mGlobalVariables->setInt ("pcrace", 3);
mWorldScene = new Scene(*mRendering, mPhysics);
setFallbackValues(fallbackMap);
@ -802,7 +804,23 @@ namespace MWWorld
const ESM::NPC *World::createRecord(const ESM::NPC &record)
{
bool update = false;
if (StringUtils::ciEqual(record.mId, "player")) {
if (StringUtils::ciEqual(record.mId, "player"))
{
static const char *sRaces[] =
{
"Argonian", "Breton", "Dark Elf", "High Elf", "Imperial", "Khajiit", "Nord", "Orc", "Redguard",
"Woodelf", 0
};
int i=0;
for (; sRaces[i]; ++i)
if (StringUtils::ciEqual (sRaces[i], record.mRace))
break;
mGlobalVariables->setInt ("pcrace", sRaces[i] ? i+1 : 0);
const ESM::NPC *player =
mPlayer->getPlayer().get<ESM::NPC>()->mBase;

Loading…
Cancel
Save