mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 15:19:42 +00:00
book skillgain
This commit is contained in:
parent
a34bdb9623
commit
853d62adba
1 changed files with 6 additions and 7 deletions
|
@ -35,22 +35,21 @@ namespace MWWorld
|
||||||
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(getTarget());
|
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(getTarget());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer();
|
||||||
|
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||||
|
|
||||||
// Skill gain from books
|
// Skill gain from books
|
||||||
if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length)
|
if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length
|
||||||
|
&& !npcStats.hasBeenUsed (ref->base->name))
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer();
|
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
|
||||||
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
||||||
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
||||||
playerRef->base->cls);
|
playerRef->base->cls);
|
||||||
|
|
||||||
npcStats.increaseSkill (ref->base->data.skillID, *class_, true);
|
npcStats.increaseSkill (ref->base->data.skillID, *class_, true);
|
||||||
|
|
||||||
/// \todo Remove skill from the book. Right now you can read as many times as you want
|
npcStats.flagAsUsed (ref->base->name);
|
||||||
/// and the skill will still increase.
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue