Comment 30 for bug 1772845

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

As I don't really understand all expressions in C++ doing a proper review is hard for me. Onbly question is: Why should we use a generic function for very specific purposes like in this case. My suggestion would have been to use something like "supporters_nearby.at("ware")" and hardcode the relevant ware for every building as it is already hardcoded with the AI hint. Reason is:
for example we have a hint "collects_ware_from_map = meat" to identify a kHunter so we already Know that a hunter will produce meat. This is asserted by the functions GunChleoc added to productionsites.cc. So if we want to seperate the hunter from other hunter we could punish any other "meat" producer in the vicinity instead of using generic bo.outputs.at(0) which needs to be "meat" anyway. same is for supporting the vicinity of a supporter.
in short I think we could use a hardcoded value in a piece of code which is only reachable by exactly having this hardcoded value.