Fix web link in item customtext being visible

fixes
Nimetu 3 years ago
parent 3f991d3781
commit c00a9be398

@ -1907,9 +1907,17 @@ void getItemText (CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS)
const CClientItemInfo &itemInfo = getInventory().getItemInfo(getInventory().getItemSlotId(item) ); const CClientItemInfo &itemInfo = getInventory().getItemInfo(getInventory().getItemSlotId(item) );
if (!itemInfo.CustomText.empty()) if (!itemInfo.CustomText.empty())
{ {
strFindReplace(itemText, "%custom_text", "\n@{FFFF}" + itemInfo.CustomText + "\n"); std::string text = itemInfo.CustomText.toUtf8();
ucstring itemMFC = CI18N::get("uiItemTextMessageFromCrafter"); if (text.size() > 3 && text[0]=='@' && ((text[1]=='W' && text[2]=='E' && text[3]=='B') || (text[1]=='L' && text[2]=='U' && text[3]=='A')))
strFindReplace(itemText, "%mfc", itemMFC); {
strFindReplace(itemText, "%custom_text", string() );
}
else
{
strFindReplace(itemText, "%custom_text", "\n@{FFFF}" + itemInfo.CustomText.toUtf8() + "\n");
string itemMFC = CI18N::get("uiItemTextMessageFromCrafter");
strFindReplace(itemText, "%mfc", itemMFC);
}
} }
else else
strFindReplace(itemText, "%custom_text", ucstring() ); strFindReplace(itemText, "%custom_text", ucstring() );

Loading…
Cancel
Save