View Single Post
  #4  
Old 03-29-2016, 06:05 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 89,043
Kyttias is on a distinguished road
Default

Don't you already update the companion and delete the item in your existing functions???? The error has nothing to do with my code. I'm starting to think you removed your function and replaced with just my if statement -- all my code does is transform an old companion, if such a thing exists, into an item again.
PHP Code:
function items_companion($item$adopt){
  
$mysidia Registry::get("mysidia");

//MY CODE
if ($adopt->getCompanion() != "nocompanion") { 
    
$item = new StockItem($adopt->getCompanion()); 
    
$item->append(1$mysidia->user->username); 
}

//WITH YOURS
  
$companion $item->itemname;
  
$mysidia->db->update("owned_adoptables", array("companion" => $companion), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
  
$note "You have given your pet a <b>{$item->itemname}</b>! It will now show up in your pet's profile. ";
  
//Update item quantity...
  
$delitem $item->remove(); 
  return 
$note;

Try that?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 03-29-2016 at 06:10 PM.
Reply With Quote