fix: fixed Xbox 360 build issues
This commit is contained in:
@@ -110,12 +110,22 @@ Item *ItemInstance::getItem() const
|
||||
|
||||
Icon *ItemInstance::getIcon()
|
||||
{
|
||||
return getItem()->getIcon(shared_from_this());
|
||||
Item *item = getItem();
|
||||
if(item != NULL)
|
||||
{
|
||||
return item->getIcon(shared_from_this());
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ItemInstance::getIconType()
|
||||
{
|
||||
return getItem()->getIconType();
|
||||
Item *item = getItem();
|
||||
if(item != NULL)
|
||||
{
|
||||
return item->getIconType();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ItemInstance::useOn(shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly)
|
||||
@@ -555,6 +565,7 @@ vector<HtmlString> *ItemInstance::getHoverText(shared_ptr<Player> player, bool a
|
||||
{
|
||||
vector<HtmlString> *lines = new vector<HtmlString>();
|
||||
Item *item = Item::items[id];
|
||||
|
||||
HtmlString title = HtmlString(getHoverName());
|
||||
|
||||
if (hasCustomHoverName())
|
||||
@@ -562,38 +573,12 @@ vector<HtmlString> *ItemInstance::getHoverText(shared_ptr<Player> player, bool a
|
||||
title.italics = true;
|
||||
}
|
||||
|
||||
// 4J: This is for showing aux values, not useful in console version
|
||||
/*
|
||||
if (advanced)
|
||||
{
|
||||
wstring suffix = L"";
|
||||
|
||||
if (title.length() > 0)
|
||||
{
|
||||
title += L" (";
|
||||
suffix = L")";
|
||||
}
|
||||
|
||||
if (isStackedByData())
|
||||
{
|
||||
title += String.format("#%04d/%d%s", id, auxValue, suffix);
|
||||
}
|
||||
else
|
||||
{
|
||||
title += String.format("#%04d%s", id, suffix);
|
||||
}
|
||||
}
|
||||
else if (!hasCustomHoverName() && id == Item::map_Id)
|
||||
*/
|
||||
|
||||
/*if (!hasCustomHoverName() && id == Item::map_Id)
|
||||
{
|
||||
title.text += L" #" + _toString(auxValue);
|
||||
}*/
|
||||
|
||||
lines->push_back(title);
|
||||
|
||||
item->appendHoverText(shared_from_this(), player, lines, advanced);
|
||||
if(item != NULL)
|
||||
{
|
||||
item->appendHoverText(shared_from_this(), player, lines, advanced);
|
||||
}
|
||||
|
||||
if (hasTag())
|
||||
{
|
||||
@@ -688,7 +673,10 @@ vector<HtmlString> *ItemInstance::getHoverTextOnly(shared_ptr<Player> player, bo
|
||||
vector<HtmlString> *lines = new vector<HtmlString>();
|
||||
Item *item = Item::items[id];
|
||||
|
||||
item->appendHoverText(shared_from_this(), player, lines, advanced);
|
||||
if(item != NULL)
|
||||
{
|
||||
item->appendHoverText(shared_from_this(), player, lines, advanced);
|
||||
}
|
||||
|
||||
if (hasTag())
|
||||
{
|
||||
@@ -718,12 +706,19 @@ bool ItemInstance::isFoil()
|
||||
|
||||
const Rarity *ItemInstance::getRarity()
|
||||
{
|
||||
return getItem()->getRarity(shared_from_this());
|
||||
Item *item = getItem();
|
||||
if(item != NULL)
|
||||
{
|
||||
return item->getRarity(shared_from_this());
|
||||
}
|
||||
return Rarity::common;
|
||||
}
|
||||
|
||||
bool ItemInstance::isEnchantable()
|
||||
{
|
||||
if (!getItem()->isEnchantable(shared_from_this())) return false;
|
||||
Item *item = getItem();
|
||||
if(item == NULL) return false;
|
||||
if (!item->isEnchantable(shared_from_this())) return false;
|
||||
if (isEnchanted()) return false;
|
||||
return true;
|
||||
}
|
||||
@@ -816,7 +811,15 @@ attrAttrModMap *ItemInstance::getAttributeModifiers()
|
||||
}
|
||||
else
|
||||
{
|
||||
result = getItem()->getDefaultAttributeModifiers();
|
||||
Item *item = getItem();
|
||||
if(item != NULL)
|
||||
{
|
||||
result = item->getDefaultAttributeModifiers();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new attrAttrModMap();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user