From: <Jef...@us...> - 2008-09-29 23:32:03
|
Revision: 18670 http://bzflag.svn.sourceforge.net/bzflag/?rev=18670&view=rev Author: JeffM2501 Date: 2008-09-29 23:31:49 +0000 (Mon, 29 Sep 2008) Log Message: ----------- use a bzdb var for the max movement magnitude to allow a self destruct (default to 0.01). Modified Paths: -------------- trunk/bzflag/include/StateDatabase.h trunk/bzflag/src/bzflag/clientCommands.cxx trunk/bzflag/src/common/StateDatabase.cxx trunk/bzflag/src/common/global.cxx Modified: trunk/bzflag/include/StateDatabase.h =================================================================== --- trunk/bzflag/include/StateDatabase.h 2008-09-29 21:35:33 UTC (rev 18669) +++ trunk/bzflag/include/StateDatabase.h 2008-09-29 23:31:49 UTC (rev 18670) @@ -259,6 +259,7 @@ static const std::string BZDB_LRADRATE; static const std::string BZDB_MAXBUMPHEIGHT; static const std::string BZDB_MAXFLAGGRABS; + static const std::string BZDB_MAXSELFDESTRUCTVEL; static const std::string BZDB_MAXLOD; static const std::string BZDB_MIRROR; static const std::string BZDB_MOMENTUMLINACC; Modified: trunk/bzflag/src/bzflag/clientCommands.cxx =================================================================== --- trunk/bzflag/src/bzflag/clientCommands.cxx 2008-09-29 21:35:33 UTC (rev 18669) +++ trunk/bzflag/src/bzflag/clientCommands.cxx 2008-09-29 23:31:49 UTC (rev 18670) @@ -371,7 +371,7 @@ destructCountdown = 0.0f; hud->setAlert(1, "Self Destruct cancelled", 1.5f, true); } else { - if (getMagnitude(myTank->getVelocity()) > 0.01f) + if (getMagnitude(myTank->getVelocity()) > BZDB.eval(StateDatabase::BZDB_MAXSELFDESTRUCTVEL)) { sprintf(msgBuf, "No Self Destruct while moving"); hud->setAlert(1, msgBuf, 1.0f, false); Modified: trunk/bzflag/src/common/StateDatabase.cxx =================================================================== --- trunk/bzflag/src/common/StateDatabase.cxx 2008-09-29 21:35:33 UTC (rev 18669) +++ trunk/bzflag/src/common/StateDatabase.cxx 2008-09-29 23:31:49 UTC (rev 18670) @@ -149,6 +149,7 @@ const std::string StateDatabase::BZDB_LRADRATE = std::string("_lRAdRate"); const std::string StateDatabase::BZDB_MAXBUMPHEIGHT = std::string("_maxBumpHeight"); const std::string StateDatabase::BZDB_MAXFLAGGRABS = std::string("_maxFlagGrabs"); +const std::string StateDatabase::BZDB_MAXSELFDESTRUCTVEL= std::string("_maxSelfDestructVel"); const std::string StateDatabase::BZDB_MAXLOD = std::string("_maxLOD"); const std::string StateDatabase::BZDB_MIRROR = std::string("_mirror"); const std::string StateDatabase::BZDB_MOMENTUMLINACC = std::string("_momentumLinAcc"); Modified: trunk/bzflag/src/common/global.cxx =================================================================== --- trunk/bzflag/src/common/global.cxx 2008-09-29 21:35:33 UTC (rev 18669) +++ trunk/bzflag/src/common/global.cxx 2008-09-29 23:31:49 UTC (rev 18670) @@ -90,6 +90,7 @@ { "_maxBumpHeight", "0.33", false, StateDatabase::Locked}, { "_maxFlagGrabs", "4.0", false, StateDatabase::Locked}, { "_maxLOD", "32767.0", false, StateDatabase::Locked}, + { "_maxSelfDestructVel", "0.01", false, StateDatabase::Locked}, { "_mirror", "none", false, StateDatabase::Locked}, { "_momentumAngAcc", "1.0", false, StateDatabase::Locked}, { "_momentumLinAcc", "1.0", false, StateDatabase::Locked}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |