Replacing with
Soldier * worst_guy = find_least_suited_soldier(); if (worst_guy == NULL) { log("MilitarySite::swapSoldiers: error: Could not find least suited soldier"); return false; } int32_t wg_level = worst_guy->get_level(atrTotal);
does indeed produce the error output and prevent crash.
Replacing with
Soldier * worst_guy = find_least_ suited_ soldier( ); MilitarySite: :swapSoldiers: error: Could not find least suited soldier"); >get_level( atrTotal) ;
if (worst_guy == NULL) {
log("
return false;
}
int32_t wg_level = worst_guy-
does indeed produce the error output and prevent crash.