Minor bug fixes

This commit is contained in:
Michael Cook (mackal) 2014-11-26 18:29:07 -05:00
parent daec5bde66
commit c5c778f575
2 changed files with 17 additions and 17 deletions

View File

@ -1803,7 +1803,7 @@ bool ItemInst::CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Con
if (ItemToTry->ItemType == ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0) if (ItemToTry->ItemType == ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
return false; return false;
if (AllowAll && Container->CharmFile != "ITEMTRANSFIGSHIELD" && Container->CharmFile != "ITEMTransfigBow") { if (AllowAll && !strncasecmp(Container->CharmFile, "ITEMTRANSFIGSHIELD", 18) && !strncasecmp(Container->CharmFile, "ITEMTransfigBow", 15)) {
switch (ItemToTry->ItemType) { switch (ItemToTry->ItemType) {
case 0: case 0:
case 1: case 1:
@ -1817,28 +1817,28 @@ bool ItemInst::CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Con
} }
static std::map<std::string, int> types = { static std::map<std::string, int> types = {
{ "ITEMTransfig1HP", 2 }, { "itemtransfig1hp", 2 },
{ "ITEMTransfig1HS", 0 }, { "itemtransfig1hs", 0 },
{ "ITEMTransfig2HB", 4 }, { "itemtransfig2hb", 4 },
{ "ITEMTransfig2HP", 35 }, { "itemtransfig2hp", 35 },
{ "ITEMTransfig2HS", 1 }, { "itemtransfig2hs", 1 },
{ "ITEMTransfigBlunt", 3 }, { "itemtransfigblunt", 3 },
{ "ITEMTransfigBow", 5 }, { "itemtransfigbow", 5 },
{ "ITEMTransfigHTH", 45 }, { "itemtransfighth", 45 },
{ "ITEMTRANSFIGSHIELD", 8 }, { "itemtransfigshield", 8 },
{ "ITEMTransfigSlashing", 0 } { "itemtransfigslashing", 0 }
}; };
auto i = types.find(Container->CharmFile); auto i = types.find(MakeLowerString(Container->CharmFile));
if (i != types.end() && i->second == ItemToTry->ItemType) if (i != types.end() && i->second == ItemToTry->ItemType)
return true; return true;
static std::map<std::string, int> typestwo = { static std::map<std::string, int> typestwo = {
{ "ITEMTransfigBlunt", 4 }, { "itemtransfigblunt", 4 },
{ "ITEMTransfigSlashing", 1 } { "itemtransfigslashing", 1 }
}; };
i = typestwo.find(Container->CharmFile); i = typestwo.find(MakeLowerString(Container->CharmFile));
if (i != typestwo.end() && i->second == ItemToTry->ItemType) if (i != typestwo.end() && i->second == ItemToTry->ItemType)
return true; return true;

View File

@ -1,4 +1,4 @@
--Inventory table update -- Inventory table update
ALTER TABLE `inventory` ALTER TABLE `inventory`
ADD COLUMN `ornamenticon` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `custom_data`, ADD COLUMN `ornamenticon` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `custom_data`,
ADD COLUMN `ornamentidfile` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `ornamenticon`; ADD COLUMN `ornamentidfile` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `ornamenticon`;