Skip to content

Commit

Permalink
add preprocessor check for debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
gantsevdenis committed Nov 30, 2022
1 parent 84a35f5 commit b6f10a7
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/keybind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,14 @@ void kf_ToggleTeamChat()
// --------------------------------------------------------------------------
void kf_BifferBaker()
{
#ifndef DEBUG
// Bail out if we're running a _true_ multiplayer game (to prevent MP cheating)
if (runningMultiplayer())
{
noMPCheatMsg();
return;
}

#endif
// player deals far more damage, and the enemy far less
setDamageModifiers(999, 1);
std::string cmsg = astringf(_("(Player %u) is using cheat :%s"),
Expand All @@ -566,26 +567,29 @@ void kf_BifferBaker()
// --------------------------------------------------------------------------
void kf_SetEasyLevel()
{
#ifndef DEBUG
// Bail out if we're running a _true_ multiplayer game (to prevent MP cheating)
if (runningMultiplayer())
{
noMPCheatMsg();
return;
}

#endif
setDifficultyLevel(DL_EASY);
addConsoleMessage(_("Takings thing easy!"), LEFT_JUSTIFY, SYSTEM_MESSAGE);
}

// --------------------------------------------------------------------------
void kf_UpThePower()
{
#ifndef DEBUG
// Bail out if we're running a _true_ multiplayer game (to prevent MP cheating)
if (runningMultiplayer())
{
noMPCheatMsg();
return;
}
#edif
addPower(selectedPlayer, 1000);
std::string cmsg = astringf(_("(Player %u) is using cheat :%s"),
selectedPlayer, _("1000 big ones!!!"));
Expand All @@ -595,12 +599,14 @@ void kf_UpThePower()
// --------------------------------------------------------------------------
void kf_MaxPower()
{
#ifndef DEBUG
// Bail out if we're running a _true_ multiplayer game (to prevent MP cheating)
if (runningMultiplayer())
{
noMPCheatMsg();
return;
}
#endif
setPower(selectedPlayer, 100000);
std::string cmsg = astringf(_("(Player %u) is using cheat :%s"),
selectedPlayer, _("Power overwhelming"));
Expand All @@ -610,38 +616,42 @@ void kf_MaxPower()
// --------------------------------------------------------------------------
void kf_SetNormalLevel()
{
#ifndef DEBUG
// Bail out if we're running a _true_ multiplayer game (to prevent MP cheating)
if (runningMultiplayer())
{
noMPCheatMsg();
return;
}

#endif
setDifficultyLevel(DL_NORMAL);
addConsoleMessage(_("Back to normality!"), LEFT_JUSTIFY, SYSTEM_MESSAGE);
}
// --------------------------------------------------------------------------
void kf_SetHardLevel()
{
#ifndef DEBUG
// Bail out if we're running a _true_ multiplayer game (to prevent MP cheating)
if (runningMultiplayer())
{
noMPCheatMsg();
return;
}

#endif
setDifficultyLevel(DL_HARD);
addConsoleMessage(_("Getting tricky!"), LEFT_JUSTIFY, SYSTEM_MESSAGE);
}
// --------------------------------------------------------------------------
void kf_DoubleUp()
{
#ifndef DEBUG
// Bail out if we're running a _true_ multiplayer game (to prevent MP cheating)
if (runningMultiplayer())
{
noMPCheatMsg();
return;
}
#endif
setDamageModifiers(100, 50); // enemy damage halved
std::string cmsg = astringf(_("(Player %u) is using cheat :%s"),
selectedPlayer, _("Twice as nice!"));
Expand Down Expand Up @@ -716,14 +726,14 @@ void kf_FrameRate()
void kf_ShowNumObjects()
{
int droids, structures, features;

#ifndef DEBUG
// Bail out if we're running a _true_ multiplayer game (to prevent MP cheating)
if (runningMultiplayer())
{
noMPCheatMsg();
return;
}

#endif
objCount(&droids, &structures, &features);
std::string cmsg = astringf(_("(Player %u) is using a cheat :Num Droids: %d Num Structures: %d Num Features: %d"),
selectedPlayer, droids, structures, features);
Expand Down Expand Up @@ -907,11 +917,12 @@ void kf_MapCheck()
/* Raises the tile under the mouse */
void kf_RaiseTile()
{
#ifndef DEBUG
if (runningMultiplayer())
{
return; // Don't desynch if pressing 'W'...
}

#endif
raiseTile(mouseTileX, mouseTileY);
}

Expand Down

0 comments on commit b6f10a7

Please sign in to comment.