diff options
Diffstat (limited to 'engines/scumm/he/moonbase/ai_tree.cpp')
-rw-r--r-- | engines/scumm/he/moonbase/ai_tree.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/scumm/he/moonbase/ai_tree.cpp b/engines/scumm/he/moonbase/ai_tree.cpp index e3098a7b24..d18536812b 100644 --- a/engines/scumm/he/moonbase/ai_tree.cpp +++ b/engines/scumm/he/moonbase/ai_tree.cpp @@ -29,7 +29,12 @@ namespace Scumm { static int compareTreeNodes(const void *a, const void *b) { - return ((const TreeNode *)a)->value - ((const TreeNode *)b)->value; + if (((const TreeNode *)a)->value < ((const TreeNode *)b)->value) + return -1; + else if (((const TreeNode *)a)->value > ((const TreeNode *)b)->value) + return 1; + else + return 0; } Tree::Tree(AI *ai) : _ai(ai) { |