1
0
Fork 1
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:
scrawl 2014-04-26 11:03:17 +02:00
parent cd1b4218e7
commit b13b25dd1b

View file

@ -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;
}