Fixes to Crime System

Victimless crimes were removed because victims may not exist in the
case of stealing items.

Is class now uses case insensitive comparison.

Fixed issue with confiscation of stolen items.
actorid
Jeffrey Haines 11 years ago
parent e2fab228f9
commit 6733a1541e

@ -1305,7 +1305,7 @@ namespace MWClass
bool Npc::isClass(const MWWorld::Ptr& ptr, const std::string &className) const
{
return ptr.get<ESM::NPC>()->mBase->mClass == className;
return Misc::StringUtils::ciEqual(ptr.get<ESM::NPC>()->mBase->mClass, className);
}
const ESM::GameSetting *Npc::fMinWalkSpeed;

@ -805,8 +805,8 @@ namespace MWMechanics
// NOTE: int arg can be from itemTaken() so DON'T modify it, since it is
// passed to reportCrime later on in this function.
// Only player can commit crime and no victimless crimes
if (ptr.getRefData().getHandle() != "player" || victim.isEmpty())
// Only player can commit crime
if (ptr.getRefData().getHandle() != "player")
return false;
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();

@ -814,6 +814,7 @@ namespace MWScript
{
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
player.getClass().getNpcStats(player).setBounty(0);
MWBase::Environment::get().getWorld()->confiscateStolenItems(player);
MWBase::Environment::get().getWorld()->getPlayer().recordCrimeId();
}
};
@ -825,7 +826,6 @@ namespace MWScript
{
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
player.getClass().getNpcStats(player).setBounty(0);
MWBase::Environment::get().getWorld()->confiscateStolenItems(player);
MWBase::Environment::get().getWorld()->getPlayer().recordCrimeId();
}
};

Loading…
Cancel
Save