From d9433aa8787da1676359b39416233cba27a37763 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 6 May 2010 16:49:27 +0200 Subject: [PATCH] Bad bug that had to be corrected --- dfhack/DFHackAPI.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dfhack/DFHackAPI.cpp b/dfhack/DFHackAPI.cpp index 407a6b595..9aea26544 100644 --- a/dfhack/DFHackAPI.cpp +++ b/dfhack/DFHackAPI.cpp @@ -37,6 +37,7 @@ distribution. #include "modules/Maps.h" #include "modules/Materials.h" +#include "modules/Items.h" #include "modules/Position.h" #include "modules/Gui.h" #include "modules/Creatures.h" @@ -148,6 +149,11 @@ bool API::Detach() delete d->materials; d->materials = 0; } + if(d->items) + { + delete d->items; + d->items = 0; + } if(d->gui) { delete d->gui; @@ -265,6 +271,13 @@ Materials * API::getMaterials() return d->materials; } +Items * API::getItems() +{ + if(!d->items) + d->items = new Items(d); + return d->items; +} + Translation * API::getTranslation() { if(!d->translation)