From 0bffb5795ce469c1cb76af2def08cf1540095ee2 Mon Sep 17 00:00:00 2001 From: Ammon Smith Date: Sat, 10 Jul 2021 19:48:50 -0400 Subject: [PATCH 1/2] Move land check functions to the top. --- landlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/landlock.cpp b/landlock.cpp index 690a635ce..d9ccd70a9 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -250,6 +250,7 @@ EX int isRandland(eLand l) { EX bool incompatible1(eLand l1, eLand l2) { if(isCrossroads(l1) && isCrossroads(l2)) return true; + if(isElemental(l1) && isElemental(l2)) return true; if(l1 == laJungle && l2 == laMotion) return true; if(l1 == laMirrorOld && l2 == laMotion) return true; if(l1 == laPower && l2 == laWineyard) return true; @@ -271,7 +272,6 @@ EX bool incompatible1(eLand l1, eLand l2) { if(l1 == laPrairie && l2 == laCrossroads4) return true; if(l1 == laWet && l2 == laDesert) return true; if(l1 == laFrog && l2 == laMotion) return true; - if(isElemental(l1) && isElemental(l2)) return true; return false; } From 42bcdf7da68930acb930f7900f8c10ce3e79f76c Mon Sep 17 00:00:00 2001 From: Ammon Smith Date: Sat, 10 Jul 2021 23:25:30 -0400 Subject: [PATCH 2/2] Move symmetric checks to incompatible(). --- landlock.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/landlock.cpp b/landlock.cpp index d9ccd70a9..ee614ce4e 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -249,8 +249,6 @@ EX int isRandland(eLand l) { } EX bool incompatible1(eLand l1, eLand l2) { - if(isCrossroads(l1) && isCrossroads(l2)) return true; - if(isElemental(l1) && isElemental(l2)) return true; if(l1 == laJungle && l2 == laMotion) return true; if(l1 == laMirrorOld && l2 == laMotion) return true; if(l1 == laPower && l2 == laWineyard) return true; @@ -298,7 +296,10 @@ EX eLand randomElementalLandWeighted() { } EX bool incompatible(eLand nw, eLand old) { - return (nw == old) || incompatible1(nw, old) || incompatible1(old, nw); + if(isCrossroads(nw) && isCrossroads(old)) return true; + if(isElemental(nw) && isElemental(old)) return true; + if(nw == old) return true; + return incompatible1(nw, old) || incompatible1(old, nw); } EX bool rlyehComplete() {