Skip to content

Commit

Permalink
In a low-pop case (one fertile mom), avoid getting born to mothers th…
Browse files Browse the repository at this point in the history
…at you have cursed, and don't go to d-town if that lone mother has you cursed. Spawn as a normal Eve instead. This makes the 1-v-1 situation on a low-pop server more sane, in the case where both people have each other cursed, and prevents a lone griefer from monopolizing the whole server by killing or cursing all incoming babies. However, in the N=3 case, where two mothers agree about one griefer, that griefer will still go two d-town. Also, in all cases, if we have a choice between mothers, avoid those that we have curse-blocked, if possible. The 'if possible' part prevents us from cursing everyone in hopes of being Eve. Fixes #529.
  • Loading branch information
jasonrohrer committed Feb 6, 2020
1 parent 40a9dc1 commit 1a6407f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
12 changes: 12 additions & 0 deletions documentation/changeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ Version 309 ???

--CURSE MY BABY now works forever, until you have another baby. Part of #529

--In a low-pop case (one fertile mom), avoid getting born to mothers that you
have cursed, and don't go to d-town if that lone mother has you cursed.
Spawn as a normal Eve instead. This makes the 1-v-1 situation on a low-pop
server more sane, in the case where both people have each other cursed, and
prevents a lone griefer from monopolizing the whole server by killing or
cursing all incoming babies. However, in the N=3 case, where two mothers
agree about one griefer, that griefer will still go two d-town. Also, in all
cases, if we have a choice between mothers, avoid those that we have
curse-blocked, if possible. The 'if possible' part prevents us from cursing
everyone in hopes of being Eve. Fixes #529.





Expand Down
46 changes: 46 additions & 0 deletions server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7658,6 +7658,52 @@ int processLoggedInPlayer( char inAllowReconnect,
}


if( parentChoices.size() > 1 ) {
// filter them so that we avoid mothers who WE have curse-blocked
// (only if we have a choice)
SimpleVector<LiveObject*> oldParentList;
oldParentList.push_back_other( &parentChoices );

for( int i=0; i<parentChoices.size(); i++ ) {
LiveObject *mom = parentChoices.getElementDirect( i );

if( isCursed( newObject.email, mom->email ) ) {
parentChoices.deleteElement( i );
i--;
}
}
if( parentChoices.size() == 0 ) {
// restore original list, we have them all curse-blocked
parentChoices.push_back_other( &oldParentList );
}
}
else if( parentChoices.size() == 1 && countFertileMothers() == 1 ) {
// only one possible mom

// make sure WE don't have THEM curse blocked
LiveObject *mom = parentChoices.getElementDirect( 0 );

if( isCursed( newObject.email, mom->email ) ) {
AppLog::info(
"We have only fertile mom on server curse-blocked. "
"Avoiding her, and not going to d-town, spawning new Eve" );
parentChoices.deleteAll();

// don't send ourselves to d-town in this case
numBirthLocationsCurseBlocked = 0;
}
}
else if( parentChoices.size() == 0 &&
numBirthLocationsCurseBlocked > 0 &&
countFertileMothers() == 1 ) {
// there's only one mom on the server, and we're curse-blocked from her
// don't send us to d-town in this case
numBirthLocationsCurseBlocked = 0;

AppLog::info(
"Only fertile mom on server has us curse-blocked. "
"Avoiding her, and not going to d-town, spawning new Eve" );
}


if( parentChoices.size() > 0 ) {
Expand Down

0 comments on commit 1a6407f

Please sign in to comment.