1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 09:53:50 +00:00

Redemption compatibility fix

This commit is contained in:
Marc Zinnschlag 2010-09-26 10:01:30 +02:00
parent 12a15e3fb7
commit 49f68e08bf
2 changed files with 79 additions and 60 deletions

View file

@ -27,8 +27,11 @@ namespace MWMechanics
npcStats.mSkill[i].setBase (player->npdt52.skills[i]);
// race
if (mRaceSelected)
{
const ESM::Race *race =
mEnvironment.mWorld->getStore().races.find (mEnvironment.mWorld->getPlayerPos().getRace());
mEnvironment.mWorld->getStore().races.find (
mEnvironment.mWorld->getPlayerPos().getRace());
bool male = mEnvironment.mWorld->getPlayerPos().isMale();
@ -62,9 +65,18 @@ namespace MWMechanics
}
}
// TODO handle magic effects
}
// birthsign
if (!mEnvironment.mWorld->getPlayerPos().getBirthsign().empty())
{
// TODO handle magic effects
}
// class
if (mClassSelected)
{
const ESM::Class& class_ = mEnvironment.mWorld->getPlayerPos().getClass();
for (int i=0; i<2; ++i)
@ -109,6 +121,7 @@ namespace MWMechanics
}
}
}
}
// calculate dynamic stats
int strength = creatureStats.mAttributes[0].getBase();
@ -127,7 +140,8 @@ namespace MWMechanics
}
MechanicsManager::MechanicsManager (MWWorld::Environment& environment)
: mEnvironment (environment), mUpdatePlayer (true)
: mEnvironment (environment), mUpdatePlayer (true), mClassSelected (false),
mRaceSelected (false)
{
buildPlayer();
}
@ -267,6 +281,7 @@ namespace MWMechanics
{
mEnvironment.mWorld->getPlayerPos().setGender (male);
mEnvironment.mWorld->getPlayerPos().setRace (race);
mRaceSelected = true;
buildPlayer();
mUpdatePlayer = true;
}
@ -280,6 +295,7 @@ namespace MWMechanics
void MechanicsManager::setPlayerClass (const std::string& id)
{
mEnvironment.mWorld->getPlayerPos().setClass (*mEnvironment.mWorld->getStore().classes.find (id));
mClassSelected = true;
buildPlayer();
mUpdatePlayer = true;
}
@ -287,6 +303,7 @@ namespace MWMechanics
void MechanicsManager::setPlayerClass (const ESM::Class& class_)
{
mEnvironment.mWorld->getPlayerPos().setClass (class_);
mClassSelected = true;
buildPlayer();
mUpdatePlayer = true;
}

View file

@ -23,6 +23,8 @@ namespace MWMechanics
CreatureStats mWatchedCreature;
NpcStats mWatchedNpc;
bool mUpdatePlayer;
bool mClassSelected;
bool mRaceSelected;
void buildPlayer();
///< build player according to stored class/race/birthsign information. Will