Make setrel() refuse to change relations to self
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 5 Feb 2011 08:31:44 +0000 (09:31 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Feb 2011 15:06:22 +0000 (16:06 +0100)
No current caller actually attempts that, but let's make it obvious.

src/lib/subs/rej.c

index 9663e7299998ed0af0fcbe8186246be52a01f70c..05a2a81452fe3adfe1da57d74d0cb71238e0bffc 100644 (file)
@@ -60,6 +60,8 @@ setrel(natid us, natid them, int rel)
        rel = ALLIED;
     if (CANT_HAPPEN(!mynp || !themnp))
        return;
+    if (us == them)
+       return;
     oldrel = getrel(mynp, them);
     if (oldrel == rel)
        return;