Make setrel() refuse to change relations to self

No current caller actually attempts that, but let's make it obvious.
This commit is contained in:
Markus Armbruster 2011-02-05 09:31:44 +01:00
parent d4f0cb3576
commit 985ec19f8b

View file

@ -60,6 +60,8 @@ setrel(natid us, natid them, int rel)
rel = ALLIED; rel = ALLIED;
if (CANT_HAPPEN(!mynp || !themnp)) if (CANT_HAPPEN(!mynp || !themnp))
return; return;
if (us == them)
return;
oldrel = getrel(mynp, them); oldrel = getrel(mynp, them);
if (oldrel == rel) if (oldrel == rel)
return; return;