mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 22:45:34 +00:00
Fixes #1295: Support partial matches in Cell filter
This commit is contained in:
parent
cd1b4218e7
commit
b13b25dd1b
1 changed files with 7 additions and 1 deletions
|
@ -111,8 +111,14 @@ bool MWDialogue::Filter::testPlayer (const ESM::DialInfo& info) const
|
|||
|
||||
// check cell
|
||||
if (!info.mCell.empty())
|
||||
if (!Misc::StringUtils::ciEqual(player.getCell()->getCell()->mName, info.mCell))
|
||||
{
|
||||
// supports partial matches, just like getPcCell
|
||||
const std::string& playerCell = player.getCell()->getCell()->mName;
|
||||
bool match = playerCell.length()>=info.mCell.length() &&
|
||||
Misc::StringUtils::ciEqual(playerCell.substr (0, info.mCell.length()), info.mCell);
|
||||
if (!match)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue