mix module error
Posted: Wed Mar 26, 2014 4:30 pm
ok i found a problem on the mix module:
i created a mix formula in the table where: 2 health potion = 1 apple
it works!
but i found an error:
if i have "1 health potion" in the inventory.
and try to mix it with only the quanity of "1 health potion" in my inventory. i get an error.
for example:
(1)Health potion
(1)Health potion
Error: Un-handled Exception: The inventory doesn't contain any of those objects.
Error in "/home/thirdlif/public_html/nwe/libs/items.php"
Line 243
Error in /home/thirdlif/public_html/nwe/libs/common.php
Line 554
Error in /home/thirdlif/public_html/nwe/index.php
Line 328
i think you forgot to write an error message for this area, alain.
EDITED: ok i think i fix it. here is the new code,which need to be added:
if ($result->EOF)
{
ErrorMessage("Those do not mix well.");
}
// add this new area here
//---------------------------------------------------------------------------
elseif (Item::OwnedNumber($m1) == 1 and (Item::OwnedNumber($m2) == 1))
{
if (Item::GetInventoryObject($m1) == Item::GetInventoryObject($m1))
{
ErrorMessage("Your quantity of item must be more than 1.");
}
elseif (Item::GetInventoryObject($m2) == Item::GetInventoryObject($m2))
{
ErrorMessage("Your quantity of item must be more than 1.");
}
}
//----------------------------------------------------------------------------
else
{
i created a mix formula in the table where: 2 health potion = 1 apple
it works!
but i found an error:
if i have "1 health potion" in the inventory.
and try to mix it with only the quanity of "1 health potion" in my inventory. i get an error.
for example:
(1)Health potion
(1)Health potion
Error: Un-handled Exception: The inventory doesn't contain any of those objects.
Error in "/home/thirdlif/public_html/nwe/libs/items.php"
Line 243
Error in /home/thirdlif/public_html/nwe/libs/common.php
Line 554
Error in /home/thirdlif/public_html/nwe/index.php
Line 328
i think you forgot to write an error message for this area, alain.
EDITED: ok i think i fix it. here is the new code,which need to be added:
if ($result->EOF)
{
ErrorMessage("Those do not mix well.");
}
// add this new area here
//---------------------------------------------------------------------------
elseif (Item::OwnedNumber($m1) == 1 and (Item::OwnedNumber($m2) == 1))
{
if (Item::GetInventoryObject($m1) == Item::GetInventoryObject($m1))
{
ErrorMessage("Your quantity of item must be more than 1.");
}
elseif (Item::GetInventoryObject($m2) == Item::GetInventoryObject($m2))
{
ErrorMessage("Your quantity of item must be more than 1.");
}
}
//----------------------------------------------------------------------------
else
{