summaryrefslogtreecommitdiff
path: root/src/itemsoundmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-08 18:30:40 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-08 18:30:40 +0300
commit9a0da2510f9eed57e4bc974084bf54832ee4c33c (patch)
tree28dab1528da81c40a3ca648902b91d70f854a096 /src/itemsoundmanager.cpp
parentb930f7f858b0ad91206939ed1b6d5695bc10f9cc (diff)
downloadplus-9a0da2510f9eed57e4bc974084bf54832ee4c33c.tar.gz
plus-9a0da2510f9eed57e4bc974084bf54832ee4c33c.tar.bz2
plus-9a0da2510f9eed57e4bc974084bf54832ee4c33c.tar.xz
plus-9a0da2510f9eed57e4bc974084bf54832ee4c33c.zip
add support for sounds take and put.
"take" played if take item from container like inventory "put" played if put item into container.
Diffstat (limited to 'src/itemsoundmanager.cpp')
-rw-r--r--src/itemsoundmanager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/itemsoundmanager.cpp b/src/itemsoundmanager.cpp
index 9107a4048..5fdd09ccb 100644
--- a/src/itemsoundmanager.cpp
+++ b/src/itemsoundmanager.cpp
@@ -35,7 +35,13 @@ void ItemSoundManager::playSfx(const Item *const item,
{
if (!item)
return;
- const ItemInfo &info = ItemDB::get(item->getId());
+ playSfx(item->getId(), sound);
+}
+
+void ItemSoundManager::playSfx(const int itemId,
+ const ItemSoundEvent sound)
+{
+ const ItemInfo &info = ItemDB::get(itemId);
std::string sfx = info.getSound(sound).sound;
if (sfx.empty())
{