From e2c555eebdb612f72061693bdd2dcac172bd37f2 Mon Sep 17 00:00:00 2001 From: Jason Rohrer Date: Thu, 6 Feb 2020 12:22:21 -0800 Subject: [PATCH] If your mother has no leader, you automatically follow her at birth to bootstrap leadership. Part of #532 --- documentation/changeLog.txt | 4 ++++ server/server.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/documentation/changeLog.txt b/documentation/changeLog.txt index d16a4d93d..b431bb8fc 100644 --- a/documentation/changeLog.txt +++ b/documentation/changeLog.txt @@ -45,6 +45,10 @@ Version 309 ??? --When issuing an order, the leader sees +FOLLOWER+ markers above the heads of nearby followers. +--If your mother has no leader, you automatically follow her at birth to + bootstrap leadership. Part of #532 + + Version 307 2020-January-30 diff --git a/server/server.cpp b/server/server.cpp index 63dc251bd..44585445c 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -8580,6 +8580,12 @@ int processLoggedInPlayer( char inAllowReconnect, // child inherits mother's leader newObject.followingID = parent->followingID; + if( newObject.followingID == -1 ) { + // boostrap the whole thing by having leaderless mothers + // get their children as automatic followers. + newObject.followingID = parent->id; + } + newObject.parentChainLength = parent->parentChainLength + 1;