View Single Post
  #2  
Old 04-11-2012, 04:25 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 587,136
Hall of Famer is on a distinguished road
Default

I see, thanks for bringing this up. The problem is that the method checktarget() accepts the owned_adoptables id, not the adoptables species id. For this reason it is working out in somewhat of a weird way. To fix this, find these lines in class_item.php:

PHP Code:
  public function checktarget($aid){
      
// This method checks if the item is usable
      
$item_usable FALSE;
      switch(
$this->target){
         case 
"all":
            
$item_usable TRUE;
            break;
         case 
"user":
            
$item_usable TRUE;
            break;
         default:
            
$target explode(",",$this->target);
            foreach(
$target as $temp){
               if(
$temp == $aid$item_usable TRUE
            }            
      }
      return 
$item_usable;
  } 
Replace by:

PHP Code:
public function checktarget($aid){
      
// This method checks if the item is usable
      
$id converttypetoparentid(convertidtotype($aid));
      
$item_usable FALSE;
      switch(
$this->target){
         case 
"all":
            
$item_usable TRUE;
            break;
         case 
"user":
            
$item_usable TRUE;
            break;
         default:
            
$target explode(",",$this->target);
            if(
in_array($id$target)) $item_usable TRUE;            
      }
      return 
$item_usable;
  } 
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote