Skip to content

Commit

Permalink
Your twin sibs no longer count toward your genetic score. Fixes #530
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrohrer committed Feb 6, 2020
1 parent b54ffe5 commit d2ceb57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions documentation/changeLog.txt
Expand Up @@ -71,6 +71,8 @@ Version 309 ???
slots (was 8). This is 3 extra beyond starting slots of 6, with 3 more as
headroom for when scores improve further. Part of #533

--Your twin sibs no longer count toward your genetic score. Fixes #530




Expand Down
14 changes: 12 additions & 2 deletions server/server.cpp
Expand Up @@ -7168,6 +7168,9 @@ static SimpleVector<char*> tempTwinEmails;

static char nextLogInTwin = false;

static int firstTwinID = -1;


// returns ID of new player,
// or -1 if this player reconnected to an existing ID
int processLoggedInPlayer( char inAllowReconnect,
Expand Down Expand Up @@ -8900,8 +8903,12 @@ int processLoggedInPlayer( char inAllowReconnect,
// will affect your score.

if( newObject.parentID > 0 &&
newObject.parentID == otherPlayer->parentID ) {
// sibs
newObject.parentID == otherPlayer->parentID &&
( firstTwinID == -1 || otherPlayer->id < firstTwinID ) ) {

// sibs, but NOT twins
// only consider sibs that joined before the firstTwinID in
// our twin set

newObject.ancestorIDs->push_back( otherPlayer->id );

Expand Down Expand Up @@ -9080,6 +9087,7 @@ static void processWaitingTwinConnection( FreshConnection inConnection ) {
}

nextLogInTwin = true;
firstTwinID = -1;

int newID = processLoggedInPlayer( false,
inConnection.sock,
Expand Down Expand Up @@ -9119,6 +9127,7 @@ static void processWaitingTwinConnection( FreshConnection inConnection ) {

delete [] emailCopy;

firstTwinID = newID;

LiveObject *newPlayer = NULL;

Expand Down Expand Up @@ -9207,6 +9216,7 @@ static void processWaitingTwinConnection( FreshConnection inConnection ) {
}
}

firstTwinID = -1;

char *twinCode = stringDuplicate( inConnection.twinCode );

Expand Down

0 comments on commit d2ceb57

Please sign in to comment.