Skip to content

Commit

Permalink
Makes it possible to crave all holdable objects
Browse files Browse the repository at this point in the history
6c2bfac
Should only crave craftable objects
  • Loading branch information
Defalt36 committed Jan 27, 2024
1 parent 5f9eca2 commit c9f374e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/cravings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

Craving noCraving = { -1, -1, 0 };

int eatEverythingModeEnabled = 0;




Expand Down Expand Up @@ -48,6 +50,11 @@ static Craving getRandomFood( int inLineageMaxFoodDepth,

SimpleVector<int> *allFoods = getAllPossibleFoodIDs();

if( eatEverythingModeEnabled ) {
// everything can be eaten
allFoods = getAllPossibleNonPermanentIDs();
}

SimpleVector<int> possibleFoods;

if( inLineageMaxFoodDepth > 0 ) {
Expand Down
2 changes: 2 additions & 0 deletions server/cravings.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ typedef struct Craving {

extern Craving noCraving;

extern int eatEverythingModeEnabled;



Craving getCravedFood( int inLineageEveID, int inPlayerGenerationNumber,
Expand Down
3 changes: 3 additions & 0 deletions server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7022,6 +7022,9 @@ int processLoggedInPlayer( char inAllowReconnect,

eatEverythingMode = SettingsManager::getIntSetting( "eatEverythingMode", 0 );

// change the setting from cravings
eatEverythingModeEnabled = eatEverythingMode;


numConnections ++;

Expand Down

0 comments on commit c9f374e

Please sign in to comment.