For some reason it seems to just keep resetting it to 0.
Here is the function currently:
PHP Code:
function items_health($item, $adopt){
$mysidia = Registry::get("mysidia");
$addHealth = $adopt->health + $item->value;
//Check if the adoptable's health is already at maximum.
if($adopt->health = 100){
$note = "Your gryphon is already fully healed! The {$item->itemname} was not used.";
}
//Not a maximum, but don't go overboard!
elseif($addHealth > 100){
$mysidia->db->update("owned_adoptables", array("health" => 100), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$note = "The {$item->itemname} fully healed your gryphon!";
$delitem = $item->remove();
}
//Not at maximum, won't go overboard. Proceed.
else{
$mysidia->db->update("owned_adoptables", array("health" => $addhealth), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$note = "The {$item->itemname} raised your gryphon's health by {$item->value}! Their health is now at {$addHealth}.";
$delitem = $item->remove();
}
return $note;
}
The health is at 0, and when I use the potion it now tells me that my pet is already fully healed, and it doesn't use the item up, but the health is still 0.