summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-05-28 20:06:00 +0000
committerpeter1138 <peter1138@openttd.org>2008-05-28 20:06:00 +0000
commit53aebc84c63601e0e5c8259b729f4c7b3ebea6e8 (patch)
tree93adfc71d90ad168ec81b6a9806a1b3ff8953eb6
parentf954a93ee00ec9f7c69afc306e8346d80ccbb432 (diff)
downloadopenttd-53aebc84c63601e0e5c8259b729f4c7b3ebea6e8.tar.xz
(svn r13315) -Fix (r13314): Assert if no engines or wagons available
-rw-r--r--src/engine_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp
index c9bd05650..edbc0a8ab 100644
--- a/src/engine_gui.cpp
+++ b/src/engine_gui.cpp
@@ -214,9 +214,9 @@ void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare)
*/
void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items)
{
+ if (num_items < 2) return;
assert(begin < el->Length());
assert(begin + num_items <= el->Length());
- if (num_items < 2) return;
qsort(el->Get(begin), num_items, sizeof(*el->Begin()), compare);
}