couple tweaks to transforms to it doesn't add subkeywords as types....

2nd, removed a peice of code which was originally added i imagine before list mentioner was created which added cards whos names ended in "s" to the subtypes list, this is completely unrelated to the "s" charector added to targetchooser. this was actually a really nasty hack....
previous subtypes list contained 1200 variables...the new one after this removel is about 237ish....

this does not impact foreach, or any targetchoosers ability to target a card by name, targetchooser is coded to add card names to the subtypes list as it needs them, so using foreach(arbor elf) will add this to subtypes list for targeting purposes, in the future we might want to have this kind of check done and handled outside of the subtypes list, adding card names to that list for the purpose of targeting is just dirty.

this fixes a ugly lag spike introduced with the change to subtypes...for now...we need to consider a better way to sort these in the future to avoid this returning as subtypeslist gets bigger.
This commit is contained in:
omegablast2002@yahoo.com
2011-05-09 18:10:10 +00:00
parent 6d4f0c024c
commit 8737aec005
3 changed files with 26 additions and 30 deletions

View File

@@ -182,14 +182,12 @@ void MTGCardInstance::initMTGCI()
continue;
//Erwan 2011/5/6 String comparison is expensive. Any way to do this in a cleaner way?
//I think this is releated to the fact that "Pestilence Rats" is a type for some reason, maybe we don't need that anymore
//TODO Remove the following block if possible
{
//this check is related to targetchooser instances of cards dynamically loaded subtypes.
//example(foreach(arbor elf)) adds this as a subtype for list ment.
//TODO find cheaper method
string s = Subtypes::subtypesList->find(i);
if (s.find(" ") != string::npos)
continue;
}
addType(i);
}