--- a/src/autoreplace_gui.cpp Mon Jul 16 21:11:29 2007 +0000
+++ b/src/autoreplace_gui.cpp Mon Jul 16 21:22:24 2007 +0000
@@ -8,6 +8,7 @@
#include "functions.h"
#include "table/sprites.h"
#include "table/strings.h"
+#include "strings.h"
#include "window.h"
#include "gui.h"
#include "command.h"
@@ -48,7 +49,7 @@
{
Player *p = GetPlayer(_local_player);
byte type = GetEngine(e)->type;
- uint num_engines = IsDefaultGroupID(id_g) ? p->num_engines[e] : GetGroup(id_g)->num_engines[e];
+ uint num_engines = GetGroupNumEngines(id_g, e);
if (num_engines == 0 || p->num_engines[e] == 0) {
/* We don't have any of this engine type.
@@ -140,7 +141,6 @@
*/
static void GenerateReplaceVehList(Window *w, bool draw_left)
{
- Player *p = GetPlayer(_local_player);
EngineID e;
EngineID selected_engine = INVALID_ENGINE;
byte type = w->window_number;
@@ -154,7 +154,7 @@
if (draw_left) {
const GroupID selected_group = WP(w, replaceveh_d).sel_group;
- const uint num_engines = IsDefaultGroupID(selected_group) ? p->num_engines[e] : GetGroup(selected_group)->num_engines[e];
+ const uint num_engines = GetGroupNumEngines(selected_group, e);
/* Skip drawing the engines we don't have any of and haven't set for replacement */
if (num_engines == 0 && EngineReplacementForPlayer(GetPlayer(_local_player), e, selected_group) == INVALID_ENGINE) continue;