Search failure in 3.5.x

Okay, just came across an obscure failure of the Search feature in 3.5.x–I was trying to find where a prototype was used, and the Search (with all boxes checked) found only 1 instance of the prototype name, the prototype itself. So, I assumed that prototype was old cruft that could be deleted, and removed it.

Now, certain functionality in the module is no longer working. “Huh, that’s odd,” I thought. On further investigation, it turns out that prototype was used, after all…but it was only used in some pieces created by a few “Place Marker” traits!

Would it be possible to get the search to look through markers defined in custom “Place Marker” traits, too?

Edit: To experience the search failure yourself, edit any recent English-only version of Terraforming Mars (version C2.1.x). Search for “tapped_card”–it will only be found once, at the definition of the prototype. Now, if you look at the 5 “Place Marker” traits in the “Place Color Cube” trait, you will discover that they all reference the “tapped_card” prototype!

Unfortunately “Place Marker” traits can be “endlessly recursive” (a piece can legally place a copy of itself) so I’m not sure if we can safely search INTO sub-pieces inside of traits. If we think of some good algorithm for safely doing this, it’s a good idea for improvement.


Oops, if anyone was trying to replicate my Search failure, I got mixed up about which other prototype uses the “tapped_card” prototype within its Place Marker traits–it’s actually the “action” prototype, not the “Place Color Cube” prototype!