View Single Post
  #6  
Old 03-29-2016, 08:01 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 88,970
Kyttias is on a distinguished road
Default

Mnn... it might be because the $adopt is a direct reference to the database but not to the class file. getCompanion() is in two places - try it like this, maybe?
PHP Code:
function items_companion($item$adopt){ 
  
$mysidia Registry::get("mysidia"); 

//MY CODE 
if ($adopt->companion != "nocompanion") {  
    
$item = new StockItem($adopt->companion);  
    
$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

__________________
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.
Reply With Quote