I've got the following code that is only partly working:
When this is called, the new function IS getting called, but the old one isn't. The extra stuff is being done, but hp on the actor isn't changing.
I've also tried calling it these ways:
and none of them are calling the original Game_Battler.hp= method.
Does anyone know what the correct way to call the aliased method is?
Edit: *sigh*
One final look at Google provided the answer immediately after I posted this. Why didn't I choose those particular keywords in the first place?
The answer is this:
Code:
alias_method :shaz_old_hp=, :hp=
def hp=(hp)
# do some extra stuff here
shaz_old_hp = hp
end
I've also tried calling it these ways:
Code:
shaz_old_hp=hp
shaz_old_hp= hp
shaz_old_hp=(hp)
Does anyone know what the correct way to call the aliased method is?
Edit: *sigh*
One final look at Google provided the answer immediately after I posted this. Why didn't I choose those particular keywords in the first place?
The answer is this:
Code:
self.shaz_old_hp = hp