Fix build

ryzomclassic-develop
kaetemi 4 years ago
parent be11ae1fb6
commit 8d4c0d0ef1

@ -2088,8 +2088,10 @@ void getItemText (CDBCtrlSheet *item, string &itemText, const CItemSheet*pIS)
break;
case ITEMFAMILY::PET_ANIMAL_TICKET:
{
#ifdef RYZOM_FORGE
string nr = (itemInfo.PetNumber > 0) ? toString(itemInfo.PetNumber) : "(slot)" + toString(item->getIndexInDB());
strFindReplace(itemText, "%petnumber", nr);
#endif
}
break;
default:

@ -165,9 +165,9 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived()
display->setTextFormatTaged(localDesc);
else
{
string text = itemInfo.CustomText.toUtf8();
string text = itemInfo.CustomText;
string::size_type delimiter = text.find(' ');
if(text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B')
if (NLMISC::startsWith(text, "@WEB"))
{
CGroupHTML *pGH = dynamic_cast<CGroupHTML*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:web_transactions:content:html"));
if (pGH)

@ -168,7 +168,7 @@
<leaf name="STOP_USE_XP_CAT" sendto="EGS" format="b" description="client wants to stop using xp catalyser" />
<leaf name="LOCK" sendto="EGS" format="u8 u16 b" description="lock or unlock an item. inventory, slot, lock" />
<leaf name="RENAME" sendot="EGS" format="u8 u16 b s" description="change an item name to a phrase or literal. inventory, slot, literal, name" />
<leaf name="WRITE" sendot="EGS" format="u8 u16 s" description="wrrite a crafter's message. inventory, slot, lock" />
<leaf name="WRITE" sendot="EGS" format="u8 u16 s" description="wrrite a crafter's message. inventory, slot, text" />
</branch>
<branch name="TP">
<leaf name="RESPAWN" sendto="EGS" format="" description="teleport the player to his respawn point" />

@ -367,8 +367,8 @@ namespace INVENTORIES
bms.serial( _SlotIndex, CInventoryCategoryTemplate::SlotBitSize );
uint i;
// SHEET, QUALITY, QUANTITY, USER_COLOR, CREATE_TIME and SERIAL never require compression
for (i = 0; i < 6; ++i)
// SHEET, QUALITY, QUANTITY, and USER_COLOR never require compression
for (i = 0; i < 4; ++i)
bms.serial((uint32&)_ItemProp[i], DataBitSize[i]);
// For all other the compression is simple the first bit indicates if the value is zero
@ -376,22 +376,38 @@ namespace INVENTORIES
{
for (; i < NbItemPropId; ++i)
{
bool b;
bms.serialBit(b);
if (b)
_ItemProp[i] = 0;
else
if (DataBitSize[i] < 3)
{
// Don't compress 1 or 2 bits either
bms.serial((uint32&)_ItemProp[i], DataBitSize[i]);
}
else
{
bool b;
bms.serialBit(b);
if (b)
_ItemProp[i] = 0;
else
bms.serial((uint32 &)_ItemProp[i], DataBitSize[i]);
}
}
}
else
{
for (; i != NbItemPropId; ++i)
{
bool b = (_ItemProp[i] == 0);
bms.serialBit(b);
if (!b)
if (DataBitSize[i] < 3)
{
// Don't compress 1 or 2 bits either
bms.serial((uint32&)_ItemProp[i], DataBitSize[i]);
}
else
{
bool b = (_ItemProp[i] == 0);
bms.serialBit(b);
if (!b)
bms.serial((uint32 &)_ItemProp[i], DataBitSize[i]);
}
}
}
}

@ -8317,7 +8317,7 @@ NLMISC_COMMAND(eventSetBotSheet, "Change the sheet of a bot", "<bot eid> <sheet
}
//----------------------------------------------------------------------------
extern sint32 clientEventSetItemCustomText(CCharacter* character, INVENTORIES::TInventory inventory, uint32 slot, ucstring const& text);
extern sint32 clientItemWrite(CCharacter* character, INVENTORIES::TInventory inventory, uint32 slot, ucstring const& text);
NLMISC_COMMAND(eventSetItemCustomText, "set an item custom text, which replaces help text", "<eId> <inventory> <slot in inventory> <text>")
{
@ -8337,7 +8337,7 @@ NLMISC_COMMAND(eventSetItemCustomText, "set an item custom text, which replaces
NLMISC::fromString(args[2], slot);
text.fromUtf8(args[3]);
sint32 ret = clientEventSetItemCustomText(c, inventory, slot, text);
sint32 ret = clientItemWrite(c, inventory, slot, text);
switch (ret)
{

@ -427,7 +427,7 @@ void cbClientItemRename(NLNET::CMessage &msgin, const std::string &serviceName,
/// -1: Invalid inventory
/// -2: Invalid slot
/// -3: Empty slot
sint32 cbClientItemWrite(CCharacter* character, INVENTORIES::TInventory inventory, uint32 slot, ucstring const& text)
sint32 clientItemWrite(CCharacter* character, INVENTORIES::TInventory inventory, uint32 slot, ucstring const& text)
{
if (inventory==INVENTORIES::UNDEFINED)
{
@ -504,8 +504,8 @@ void cbClientItemWrite( NLNET::CMessage& msgin, const std::string & serviceName,
}
// prevent use of @WEB at begin
if (text.size() >= 4 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B')
text = text.substr(4, text.size() - 4);
if (NLMISC::startsWith(text, "@WEB"))
text = text.substr(4);
// force that the begin of the text for non admin is %mfc
if(!text.empty() && text.substr(0, 4) != string("%mfc"))
@ -514,7 +514,7 @@ void cbClientItemWrite( NLNET::CMessage& msgin, const std::string & serviceName,
}
}
cbClientItemWrite(character, inventory, slot, text);
clientItemWrite(character, inventory, slot, text);
}
///////////////////////////////////////////////////////////////////////////////////////////////////

@ -1164,7 +1164,7 @@ void CGameItem::setAccessGrade(EGSPD::CGuildGrade::TGuildGrade value)
}
}
void CGameItem::setPhraseId(const std::string &str, bool literal = false)
void CGameItem::setPhraseId(const std::string &str, bool literal)
{
if (literal != _PhraseLiteral || _PhraseId != str)
{

Loading…
Cancel
Save