- some dangerous casts Player/MTGCardInstance fixed
- removed typeAsTarget function and replaced with dynamic casting - The test suite passes, but it is possible that I busted some of AI's features :(
This commit is contained in:
@@ -39,14 +39,14 @@ int ActionElement::getActivity()
|
||||
|
||||
int ActionElement::isReactingToTargetClick(Targetable * object)
|
||||
{
|
||||
if (object && object->typeAsTarget() == TARGET_CARD)
|
||||
return isReactingToClick((MTGCardInstance *) object);
|
||||
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
|
||||
return isReactingToClick(cObject);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ActionElement::reactToTargetClick(Targetable * object)
|
||||
{
|
||||
if (object->typeAsTarget() == TARGET_CARD)
|
||||
return reactToClick((MTGCardInstance *) object);
|
||||
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
|
||||
return reactToClick(cObject);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user