Skip to content

Commit

Permalink
Fix commander unit count on loading games.
Browse files Browse the repository at this point in the history
Add error sound, and text when you can't add any more units to the Commander.

Fixes ticket:3513
Fixes ticket:3062
  • Loading branch information
vexed committed Jun 1, 2012
1 parent 5ba90fe commit b3f3b08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/cmddroid.cpp
Expand Up @@ -34,6 +34,8 @@
#include "group.h"
#include "order.h"
#include "multiplay.h"
#include "lib/sound/audio.h"
#include "lib/sound/audio_id.h"

/**This represents the current selected player, which is the client's player.*/
extern UDWORD selectedPlayer;
Expand Down Expand Up @@ -101,6 +103,11 @@ void cmdDroidAddDroid(DROID *psCommander, DROID *psDroid)

orderDroidObj(psDroid, DORDER_GUARD, (BASE_OBJECT *)psCommander, ModeImmediate);
}
else
{
audio_PlayTrack( ID_SOUND_BUILD_FAIL );
addConsoleMessage(_("Commander needs a higher level to command more units"), DEFAULT_JUSTIFY, SYSTEM_MESSAGE);
}
}

DROID *cmdDroidGetDesignator(UDWORD player)
Expand Down
2 changes: 0 additions & 2 deletions src/game.cpp
Expand Up @@ -4116,8 +4116,6 @@ static bool loadSaveDroidPointers(const QString &pFileName, DROID **ppsCurrentDr
int tid = ini.value("commander", -1).toInt();
DROID *psCommander = (DROID *)getBaseObjFromData(tid, psDroid->player, OBJ_DROID);
ASSERT(psCommander, "Failed to find droid commander");
psCommander->psGroup = NULL;
psCommander->psGrpNext = NULL;
cmdDroidAddDroid(psCommander, psDroid);
}
ini.endGroup();
Expand Down

0 comments on commit b3f3b08

Please sign in to comment.