Fix duplicate code

new-script-api
scrawl 7 years ago
parent e4c9d84666
commit 82a211ba03

@ -365,19 +365,7 @@ namespace MWDialogue
} }
// check the available services of this actor // check the available services of this actor
int services = 0; int services = mActor.getClass().getServices(mActor);
if (mActor.getTypeName() == typeid(ESM::NPC).name())
{
MWWorld::LiveCellRef<ESM::NPC>* ref = mActor.get<ESM::NPC>();
if (ref->mBase->mHasAI)
services = ref->mBase->mAiData.mServices;
}
else if (mActor.getTypeName() == typeid(ESM::Creature).name())
{
MWWorld::LiveCellRef<ESM::Creature>* ref = mActor.get<ESM::Creature>();
if (ref->mBase->mHasAI)
services = ref->mBase->mAiData.mServices;
}
int windowServices = 0; int windowServices = 0;

@ -46,7 +46,7 @@ struct NPC
// Other services // Other services
Spells = 0x00800, Spells = 0x00800,
MagicItems = 0x01000, MagicItems = 0x01000,
Training = 0x04000, // What skills? Training = 0x04000,
Spellmaking = 0x08000, Spellmaking = 0x08000,
Enchanting = 0x10000, Enchanting = 0x10000,
Repair = 0x20000 Repair = 0x20000

Loading…
Cancel
Save