- Fixed issues and memory leaks related to decks unlocking

- Fixed an issue where a GameObserver could be null for some mana costs associated to a targetChooser
This commit is contained in:
wagic.the.homebrew
2011-10-22 13:38:43 +00:00
parent 91e9881903
commit 4c42636bd5
4 changed files with 64 additions and 3 deletions
+7
View File
@@ -826,6 +826,13 @@ bool TargetChooser::validTargetsExist(int maxTargets)
int TargetChooser::countValidTargets()
{
int result = 0;
//Some TargetChooser objects are created at a point where no observer is available
// see ManaCost::parseManaCost which sets observer to NULL in some cases (namely: when the cards database is loaded at game start)
// This is a workaround for this situation
if (!observer && source)
observer = source->getObserver();
for (int i = 0; i < 2; ++i)
{
assert(observer);