summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-12-02 20:13:12 +0000
committerglx <glx@openttd.org>2007-12-02 20:13:12 +0000
commit5da6900c3f1afcb9b2349bb3b67f4e4823c25a7c (patch)
tree9bf34721a2a41115690bf4e37bfcad9c6443ec55 /src
parent8ae661b1765122de7c789339b340e2af1ce8ce97 (diff)
downloadopenttd-5da6900c3f1afcb9b2349bb3b67f4e4823c25a7c.tar.xz
(svn r11561) -Fix [FS#1504] (r11463): group list was not updated when removing the last group
Diffstat (limited to 'src')
-rw-r--r--src/group_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index a4cd5581a..e4e0361b1 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -40,10 +40,10 @@ static void BuildGroupList(grouplist_d* gl, PlayerID owner, VehicleType vehicle_
const Group *g;
uint n = 0;
- if (!(gl->l.flags & VL_REBUILD) || GetGroupArraySize() == 0) return;
+ if (!(gl->l.flags & VL_REBUILD)) return;
list = MallocT<const Group*>(GetGroupArraySize());
- if (list == NULL) {
+ if (GetGroupArraySize() != 0 && list == NULL) {
error("Could not allocate memory for the group-sorting-list");
}