/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2018, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
*
* Known contributors to this file:
* Steve McClure, 1996
+ * Markus Armbruster, 2006-2013
*/
#include <config.h>
#include "misc.h"
#include "nat.h"
#include "prototypes.h"
-#include "xy.h"
double
hap_fact(struct natstr *tnat, struct natstr *vnat)
hap_fact = 2.0;
else /* Target has no happy, worse fighting */
hap_fact = 0.8;
- if (hap_fact > 2.0)
- hap_fact = 2.0;
- if (hap_fact < 0.8)
- hap_fact = 0.8;
- return hap_fact;
+ return LIMIT_TO(hap_fact, 0.8, 2.0);
}
-/* Return happiness required to keep NP's citizens happy. */
+/* Return happiness required to keep NP's citizens happy. */
double
hap_req(struct natstr *np)
{