issue #2423 : change TargetedAction::reverse() function from just cloning to reversing the internal action

This commit is contained in:
Huabing.Xu 2013-08-01 10:07:40 +08:00
parent 31d8200e05
commit 97f6e11f0d
1 changed files with 5 additions and 2 deletions

View File

@ -2201,8 +2201,11 @@ TargetedAction* TargetedAction::clone() const
TargetedAction* TargetedAction::reverse(void) const
{
// no reverse for this action, just clone it
return this->clone();
// just reverse the internal action
auto a = new TargetedAction();
a->initWithTarget(_forcedTarget, _action->reverse());
a->autorelease();
return a;
}
void TargetedAction::startWithTarget(Node *target)