Fixed some primitives and fixed a problem with share!types! keyword.

This commit is contained in:
valfieri
2020-06-10 23:13:18 +02:00
parent 7cf722114b
commit 60e6d314e0
4 changed files with 39 additions and 27 deletions
+2
View File
@@ -29,6 +29,8 @@ GuiLayer::~GuiLayer()
void GuiLayer::Add(JGuiObject *object)
{
if(!object)
return;
mObjects.push_back(object);
AbilityFactory af(observer);
+10
View File
@@ -769,6 +769,16 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
cd->removeType("creature");
cd->removeType("planeswalker");
cd->removeType("tribal");
#if !defined (PSP)
if (!cd->types.size())
cd->setSubtype(card->getName() + "_DummyType_" + to_string((long double)(rand() % 10000 + 1))); // Fix to avoid type vector size is 0 causing the always true match issue.
#else
if (!cd->types.size()){
int i = rand() % 10000 + 1;
ostringstream rnd;
cd->setSubtype(card->getName() + "_DummyType_" + rnd.str()); // Fix to avoid type vector size is 0 causing the always true match issue.
}
#endif
cd->mode = CardDescriptor::CD_OR;
}
}