hard coding is unfortunate of course. I wish there was an easy way to fix this for good.
One suggestion: Could you try adding a regression test?
Copy test/maps/plain.wmf/scripting/test_fires_do_not_burn_forever.lua to test/maps/plain.wmf/scripting/test_geologist_messages_do_not_crash.lua. Then change the plain.wmf map to contain a bunch of hills with all findable resources (do not forget water). Script geologists going to these hills (enough of them) and check after a while that 5 messages have arrived. Click on the button (via ui scripting) and delete one message after another - so that all will get rendered once.
hard coding is unfortunate of course. I wish there was an easy way to fix this for good.
One suggestion: Could you try adding a regression test? plain.wmf/ scripting/ test_fires_ do_not_ burn_forever. lua to test/maps/ plain.wmf/ scripting/ test_geologist_ messages_ do_not_ crash.lua. Then change the plain.wmf map to contain a bunch of hills with all findable resources (do not forget water). Script geologists going to these hills (enough of them) and check after a while that 5 messages have arrived. Click on the button (via ui scripting) and delete one message after another - so that all will get rendered once.
Copy test/maps/