lastController defined when creating copies of itself
This commit is contained in:
@@ -1208,7 +1208,7 @@ AACascade::AACascade(GameObserver* observer, int _id, MTGCardInstance * _source,
|
||||
void AACascade::toCastCard(MTGCardInstance * thisCard)
|
||||
{
|
||||
MTGAbility *ac = NEW AACastCard(game, game->mLayers->actionLayer()->getMaxId(), thisCard, thisCard,false,false,true,"","",false,false);
|
||||
MayAbility *ma1 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ac->clone(), thisCard->clone(),true);
|
||||
MayAbility *ma1 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ac->clone(), thisCard,true);
|
||||
MTGAbility *ga1 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), thisCard,NULL,ma1->clone());
|
||||
SAFE_DELETE(ac);
|
||||
SAFE_DELETE(ma1);
|
||||
|
||||
@@ -2802,7 +2802,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
vector<string> splitCascade = parseBetween(s, "cascade:", " ", false);
|
||||
if (splitCascade.size())
|
||||
{
|
||||
Targetable * t = spell ? spell->getNextTarget() : NULL;
|
||||
MTGAbility * a = NEW AACascade(observer, id, card, target, splitCascade[1], NULL);
|
||||
a->oneShot = 1;
|
||||
return a;
|
||||
|
||||
@@ -611,8 +611,6 @@ MTGCardInstance * MTGCardInstance::changeController(Player * newController,bool
|
||||
|
||||
Player * MTGCardInstance::controller()
|
||||
{
|
||||
if(!lastController)//if null then set the owner as the lastcontroller, prevents crashes...
|
||||
lastController = owner;
|
||||
return lastController;
|
||||
}
|
||||
|
||||
|
||||
@@ -564,6 +564,7 @@ MTGCardInstance * MTGGameZone::removeCard(MTGCardInstance * card, int createCopy
|
||||
copy->kicked = card->kicked;
|
||||
copy->storedCard = card->storedCard;
|
||||
copy->storedSourceCard = card->storedSourceCard;
|
||||
copy->lastController = card->controller();
|
||||
for (int i = 0; i < ManaCost::MANA_PAID_WITH_OVERLOAD +1; i++)
|
||||
copy->alternateCostPaid[i] = card->alternateCostPaid[i];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user