mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-31 21:45:33 +00:00
Fix incorrect disposition testing and get rid of of a related hack that is no longer needed.
This commit is contained in:
parent
09d491d1ba
commit
12691040d1
3 changed files with 8 additions and 9 deletions
|
@ -251,7 +251,7 @@ namespace MWDialogue
|
|||
}
|
||||
}
|
||||
|
||||
void DialogueManager::executeTopic (const std::string& topic, bool randomResponse)
|
||||
void DialogueManager::executeTopic (const std::string& topic)
|
||||
{
|
||||
Filter filter (mActor, mChoice, mTalkedTo);
|
||||
|
||||
|
@ -262,12 +262,9 @@ namespace MWDialogue
|
|||
|
||||
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
|
||||
|
||||
std::vector<const ESM::DialInfo *> infos = filter.list (dialogue, true, true);
|
||||
|
||||
if (!infos.empty())
|
||||
const ESM::DialInfo* info = filter.search(dialogue, true);
|
||||
if (info)
|
||||
{
|
||||
const ESM::DialInfo* info = infos[randomResponse ? std::rand() % infos.size() : 0];
|
||||
|
||||
parseText (info->mResponse);
|
||||
|
||||
std::string title;
|
||||
|
@ -509,7 +506,7 @@ namespace MWDialogue
|
|||
text = "Bribe";
|
||||
}
|
||||
|
||||
executeTopic (text + (success ? " Success" : " Fail"), true);
|
||||
executeTopic (text + (success ? " Success" : " Fail"));
|
||||
}
|
||||
|
||||
int DialogueManager::getTemporaryDispositionChange() const
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace MWDialogue
|
|||
bool compile (const std::string& cmd,std::vector<Interpreter::Type_Code>& code);
|
||||
void executeScript (const std::string& script);
|
||||
|
||||
void executeTopic (const std::string& topic, bool randomResponse=false);
|
||||
void executeTopic (const std::string& topic);
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/journal.hpp"
|
||||
#include "../mwbase/mechanicsmanager.hpp"
|
||||
#include "../mwbase/dialoguemanager.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/player.hpp"
|
||||
|
@ -133,7 +134,8 @@ bool MWDialogue::Filter::testDisposition (const ESM::DialInfo& info, bool invert
|
|||
if (isCreature)
|
||||
return true;
|
||||
|
||||
int actorDisposition = MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mActor);
|
||||
int actorDisposition = MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mActor)
|
||||
+ MWBase::Environment::get().getDialogueManager()->getTemporaryDispositionChange();
|
||||
// For service refusal, the disposition check is inverted. However, a value of 0 still means "always succeed".
|
||||
return invert ? (info.mData.mDisposition == 0 || actorDisposition < info.mData.mDisposition)
|
||||
: (actorDisposition >= info.mData.mDisposition);
|
||||
|
|
Loading…
Reference in a new issue