mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-19 09:27:22 -04:00
Fixes #1295: Support partial matches in Cell filter
This commit is contained in:
parent
cd1b4218e7
commit
b13b25dd1b
@ -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…
x
Reference in New Issue
Block a user