forked from mirror/openmw-tes3mp
Fix incorrect implementation of iWerewolfBounty
This commit is contained in:
parent
35d2bfabca
commit
efa9ff3a76
2 changed files with 12 additions and 10 deletions
|
@ -336,16 +336,12 @@ bool MWMechanics::NpcStats::hasBeenUsed (const std::string& id) const
|
||||||
|
|
||||||
int MWMechanics::NpcStats::getBounty() const
|
int MWMechanics::NpcStats::getBounty() const
|
||||||
{
|
{
|
||||||
if (mIsWerewolf)
|
return mBounty;
|
||||||
return MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iWereWolfBounty")->getInt();
|
|
||||||
else
|
|
||||||
return mBounty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWMechanics::NpcStats::setBounty (int bounty)
|
void MWMechanics::NpcStats::setBounty (int bounty)
|
||||||
{
|
{
|
||||||
if (!mIsWerewolf)
|
mBounty = bounty;
|
||||||
mBounty = bounty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int MWMechanics::NpcStats::getFactionReputation (const std::string& faction) const
|
int MWMechanics::NpcStats::getFactionReputation (const std::string& faction) const
|
||||||
|
|
|
@ -2476,7 +2476,7 @@ namespace MWWorld
|
||||||
getStore().get<ESM::GameSetting>().search("fAlarmRadius")->getFloat(),
|
getStore().get<ESM::GameSetting>().search("fAlarmRadius")->getFloat(),
|
||||||
closeActors);
|
closeActors);
|
||||||
|
|
||||||
bool detected = false;
|
bool detected = false, reported = false;
|
||||||
for (std::vector<MWWorld::Ptr>::const_iterator it = closeActors.begin(); it != closeActors.end(); ++it)
|
for (std::vector<MWWorld::Ptr>::const_iterator it = closeActors.begin(); it != closeActors.end(); ++it)
|
||||||
{
|
{
|
||||||
if (*it == actor)
|
if (*it == actor)
|
||||||
|
@ -2486,16 +2486,22 @@ namespace MWWorld
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (getLOS(*it, actor) && MWBase::Environment::get().getMechanicsManager()->awarenessCheck(actor, *it))
|
if (getLOS(*it, actor) && MWBase::Environment::get().getMechanicsManager()->awarenessCheck(actor, *it))
|
||||||
{
|
|
||||||
detected = true;
|
detected = true;
|
||||||
break;
|
if (it->getClass().getCreatureStats(*it).getAiSetting(MWMechanics::CreatureStats::AI_Alarm).getModified() > 0)
|
||||||
}
|
reported = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detected)
|
if (detected)
|
||||||
{
|
{
|
||||||
windowManager->messageBox("#{sWerewolfAlarmMessage}");
|
windowManager->messageBox("#{sWerewolfAlarmMessage}");
|
||||||
setGlobalInt("pcknownwerewolf", 1);
|
setGlobalInt("pcknownwerewolf", 1);
|
||||||
|
|
||||||
|
if (reported)
|
||||||
|
{
|
||||||
|
npcStats.setBounty(npcStats.getBounty()+
|
||||||
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iWereWolfBounty")->getInt());
|
||||||
|
windowManager->messageBox("#{sCrimeMessage}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue