# HG changeset patch # User sam8641 # Date 1298436201 21600 # Node ID 68a3f879af25829da0843932c5a02ce24d9f27dc # Parent 857e0ad4caf1b8faebbe7c638f99a397fb2173c6 add /cheat that enables unlimited. diff -r 857e0ad4caf1 -r 68a3f879af25 zap/game.cpp --- a/zap/game.cpp Tue Feb 22 17:19:37 2011 -0600 +++ b/zap/game.cpp Tue Feb 22 22:43:21 2011 -0600 @@ -82,6 +82,10 @@ extern ScreenInfo gScreenInfo; +extern bool cheaton; +extern bool haveCheated; + + //----------------------------------------------------------------------------------- //----------------------------------------------------------------------------------- @@ -609,6 +613,8 @@ // Pass -1 to go to next level, otherwise pass an absolute level number void ServerGame::cycleLevel(S32 nextLevel) { + haveCheated = false; + cheaton = false; cleanUp(); mLevelSwitchTimer.clear(); mScopeAlwaysList.clear(); diff -r 857e0ad4caf1 -r 68a3f879af25 zap/gameType.cpp --- a/zap/gameType.cpp Tue Feb 22 17:19:37 2011 -0600 +++ b/zap/gameType.cpp Tue Feb 22 22:43:21 2011 -0600 @@ -60,6 +60,9 @@ { extern F32 getCurrentRating(GameConnection *conn); //in game.cpp +bool cheaton = false; +bool haveCheated = false; + //RDW GCC needs this to be properly defined. -- isn't this defined in gameType.h? -CE //GCC can't link without this definition. One of the calls to min in //UITeamDefMenu.cpp requires that this have actual storage (for some reason). @@ -864,7 +867,8 @@ onGameOver(); // Call game-specific end-of-game code - saveGameStats(); + if(!haveCheated) + saveGameStats(); } @@ -2792,6 +2796,16 @@ } } } + else if(!stricmp(cmd, "cheat")) + { + if(!clientRef->clientConnection->isAdmin()) + clientRef->clientConnection->s2cDisplayMessage(GameConnection::ColorRed, SFXNone, "!!! Need admin permission"); + else + { + cheaton = !cheaton; + haveCheated = true; + } + } else { // Command not found, tell the client diff -r 857e0ad4caf1 -r 68a3f879af25 zap/ship.cpp --- a/zap/ship.cpp Tue Feb 22 17:19:37 2011 -0600 +++ b/zap/ship.cpp Tue Feb 22 22:43:21 2011 -0600 @@ -587,9 +587,14 @@ mRepairTargets[i]->damageObject(&di); } - +extern bool cheaton; void Ship::processEnergy() { + if(cheaton) + { + mEnergy = EnergyMax; + mFireTimer = 0; + } bool modActive[ModuleCount]; for(S32 i = 0; i < ModuleCount; i++) {