View Single Post
  #2  
Old 04-25-2015, 02:19 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 90,909
Kyttias is on a distinguished road
Default

Does the pet you are looking at have a next level? For example, the maximum level I have on my test site for pets is level 4. If the pet is level 4, it has no next level, and therefore calling getNextLevel() would make the function, and therefore the variable holding the function, hold the value of FALSE, an empty value.

My recommended use of getNextLevel() would be something like:
PHP Code:
if($this->hasNextLevel()){
    
$level $this->getNextLevel();
    
$levelupClicks $this->getLevelupClicks();
    
$toNext "(LVL ".$level->getLevel()." in ".$levelupClicks." more EXP)"
}
else 
$toNext "(MAX)"
and then returning $toNext. But I'm dealing with v1.3.4, and I'm not sure how different things are. I'm currently doing the above in getStats(), another function in the ownedadoptables class.
__________________
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; 04-25-2015 at 02:21 AM.
Reply With Quote