Ah, but I really don't want the game to assume I am at the end of my tether when I have five recruitment centres to sell (as well as other buildings that are not so relevant when I have a large army and few recruits). I would normally be better off getting a no-go on dragon morph and then selling those than inadvertently triggering about-to-die mode.
Of course, after a few battles I'm wary of that number to the extent that I can usually avoid this situation, but so far I have not experienced any increase in fun from this new way to lose. (Dwarf Fortress fanatics may beg to differ.)
Also, I really don't get the too complicated aspect of it. To me, trying to determine a suitable contingency for being out of resources in a game where you can always find some way to get new resources is inherently more complicated than allowing you to spawn without enough resources, and just taxing your income until the debt is settled. I find the principle far more robust, and it provides pure advantage for the dragon, which I'm okay with.
There is another alternative, but I find it more complicated on the player end: Allow the player to choose an emergency-spawn manually (perhaps button next to dragon button in GUI).
If you say "complicated" in the context of programming (given that your counterpoint is the simplicity of your code), I really don't think it would be at all difficult to code. (But ... heheh... player_recruits < 20... You mentioned that, didn't you? EDIT: Yes you did, and you caught it before my snide remark, and you wisely referred to an assumed declaration elsewhere. Yup. I'm not retracting my statement, I'm extending it, apparently.)
Can't stop myself. You'd need the underlying datatype for recruit count to support negative values (at least that's probably the simplest), you'd need to decide how to display negative values (maybe as 0 + red background, if negative number breaks immersion), and you'd probably be able to leave other code as is, because where 0 is not enough, something in the range -20 to -1 is also not enough.
Spawn dragon recruit condition would be: recruits >= 0
Spawn dragon recruit effect would be: recruits -= 20 (same as today)
Larian might have done things differently, but I would not assume this to be difficult at all.