]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/hap_fact.c
Update copyright notice
[empserver] / src / lib / common / hap_fact.c
index 1715c3cb7a4ee91f8a7f023e2e0d35fd397b0691..1eb4e73b9a674b3280c4cbcc3a191df9db900036 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  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
@@ -28,6 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 1996
+ *     Markus Armbruster, 2006-2013
  */
 
 #include <config.h>
@@ -35,7 +36,6 @@
 #include "misc.h"
 #include "nat.h"
 #include "prototypes.h"
-#include "xy.h"
 
 double
 hap_fact(struct natstr *tnat, struct natstr *vnat)
@@ -51,14 +51,10 @@ 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)
 {