summaryrefslogtreecommitdiff
path: root/src/aystar.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-10 18:56:51 +0000
committerrubidium <rubidium@openttd.org>2007-01-10 18:56:51 +0000
commitf35ed4bbc2b05f1b83476b60948d64375f77f1b4 (patch)
tree1a1c59c13ddb1d152052f3a3a0bcffe4fb531173 /src/aystar.cpp
parenta332d10fd938f345fff18e5f4a662a58f692f734 (diff)
downloadopenttd-f35ed4bbc2b05f1b83476b60948d64375f77f1b4.tar.xz
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
Diffstat (limited to 'src/aystar.cpp')
-rw-r--r--src/aystar.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/aystar.cpp b/src/aystar.cpp
index 0000d584c..36260d4f3 100644
--- a/src/aystar.cpp
+++ b/src/aystar.cpp
@@ -19,6 +19,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "aystar.h"
+#include "helpers.hpp"
int _aystar_stats_open_size;
int _aystar_stats_closed_size;
@@ -35,7 +36,8 @@ static PathNode* AyStarMain_ClosedList_IsInList(AyStar *aystar, const AyStarNode
static void AyStarMain_ClosedList_Add(AyStar *aystar, const PathNode *node)
{
// Add a node to the ClosedList
- PathNode *new_node = malloc(sizeof(*new_node));
+ PathNode *new_node;
+ MallocT(&new_node, 1);
*new_node = *node;
Hash_Set(&aystar->ClosedListHash, node->node.tile, node->node.direction, new_node);
}
@@ -66,7 +68,8 @@ static OpenListNode *AyStarMain_OpenList_Pop(AyStar *aystar)
static void AyStarMain_OpenList_Add(AyStar *aystar, PathNode *parent, const AyStarNode *node, int f, int g)
{
// Add a new Node to the OpenList
- OpenListNode *new_node = malloc(sizeof(*new_node));
+ OpenListNode *new_node;
+ MallocT(&new_node, 1);
new_node->g = g;
new_node->path.parent = parent;
new_node->path.node = *node;