mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 13:06:40 +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
|
// check cell
|
||||||
if (!info.mCell.empty())
|
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 false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue