summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r--src/resources/iteminfo.cpp35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 8dcb1c32..63b0c00e 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,10 +19,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "itemdb.h"
-#include "iteminfo.h"
+#include "resources/iteminfo.h"
-const std::string& ItemInfo::getSprite(Gender gender) const
+#include "resources/itemdb.h"
+
+const std::string &ItemInfo::getSprite(Gender gender) const
{
if (mView)
{
@@ -45,6 +45,26 @@ void ItemInfo::setWeaponType(int type)
// See server item.hpp file for type values.
switch (type)
{
+#ifdef TMWSERV_SUPPORT
+ case WPNTYPE_NONE:
+ mAttackType = ACTION_DEFAULT;
+ break;
+ case WPNTYPE_KNIFE:
+ case WPNTYPE_SWORD:
+ mAttackType = ACTION_ATTACK_STAB;
+ break;
+ case WPNTYPE_THROWN:
+ mAttackType = ACTION_ATTACK_THROW;
+ break;
+ case WPNTYPE_BOW:
+ mAttackType = ACTION_ATTACK_BOW;
+ break;
+ case WPNTYPE_POLEARM:
+ mAttackType = ACTION_ATTACK_SWING;
+ break;
+ default:
+ mAttackType = ACTION_ATTACK;
+#else
case 0: // none
mAttackType = ACTION_DEFAULT;
break;
@@ -63,6 +83,7 @@ void ItemInfo::setWeaponType(int type)
break;
default:
mAttackType = ACTION_ATTACK;
+#endif
}
}
@@ -71,7 +92,7 @@ void ItemInfo::addSound(EquipmentSoundEvent event, const std::string &filename)
mSounds[event].push_back("sfx/" + filename);
}
-const std::string& ItemInfo::getSound(EquipmentSoundEvent event) const
+const std::string &ItemInfo::getSound(EquipmentSoundEvent event) const
{
static const std::string empty;
std::map< EquipmentSoundEvent, std::vector<std::string> >::const_iterator i;