Prior to getting hit I scheduled a bunch of troops to train. Even with -2481 GH space, my troops trained and I'm amassing an army with -GH space.
80gh as gnome = 4800 troops
army out = 2823
army to be trained = 4053
army in GH = 405
total GH space in use = 7281= 122gh
Somewhere there should be a check to see if GH space is available prior to troops being real.
Thinking the system should be more like this. I don't code anymore, that's on you 😉
Before trying to train anyone, check Guard House capacity first.
If the number of current troops is already over capacity (even before training):
Immediately disband home troops to fix the overcapacity.
Do not attempt any training until the troop count is legal.
If after fixing, space is still negative (or no space available), no training happens that hour.