Auto-translated
The fix definitely needs to be added to the address I indicated. I know the logic of that function's code – and that part specifically deals with the number of creatures. Without this, your fix will only work for melee stacks, while ranged units will still be able to go into negative values when processed in that function.