From bf6e38872829f87ff408f294184da14c8c24bfd4 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 22 Oct 2010 13:09:25 +0200 Subject: Made the servers check for positive id in xml db loading. Also fixed a memleak when loading an invalid monster attack. Resolves: Mana-Mantis #215. Reviewed-by: Thorbjorn. --- src/game-server/itemmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game-server/itemmanager.cpp') diff --git a/src/game-server/itemmanager.cpp b/src/game-server/itemmanager.cpp index 802197d6..34a6170a 100644 --- a/src/game-server/itemmanager.cpp +++ b/src/game-server/itemmanager.cpp @@ -126,10 +126,10 @@ void ItemManager::reload() continue; int id = XML::getProperty(node, "id", 0); - if (!id) + if (id < 1) { - LOG_WARN("Item Manager: An item has no ID in " - << mItemReferenceFile << ", and so has been ignored!"); + LOG_WARN("Item Manager: Item ID: " << id << " is invalid in " + << mItemReferenceFile << ", and will be ignored."); continue; } -- cgit v1.2.3-70-g09d2