Lots of these laws of war exist to limit the gruesomeness of war, but if you think it's reasonably necessary for the objective of the war, these rules (legally) go out the window (completely, but to whatever extent is necessary). For example <
https://en.wikipedia.org/wiki/Proportionality_(law)>