From be0fdfc6665b671c2f1bab7db768cf17269a6258 Mon Sep 17 00:00:00 2001 From: Fabien_HENON Date: Mon, 25 Jun 2012 20:27:21 +0200 Subject: [PATCH] Changed: #1469 Converting sound names to sheet id when parsing sound triggers (camera modifier and mission action) --HG-- branch : gsoc2012-fabien --- .../camera_animation_modifiers.cpp | 10 ++++++++++ .../mission_manager/mission_action.cpp | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_modifiers.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_modifiers.cpp index 3cbe953b9..d4e8e5749 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_modifiers.cpp +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_modifiers.cpp @@ -17,6 +17,8 @@ #include "camera_animation_manager/camera_animation_modifier_factory.h" +#include "nel/misc/sheet_id.h" + ///////////////////////////////////////////////////////////////////////////// /// This animation modifier shakes the camera. The parameter is /// - strength @@ -61,12 +63,14 @@ class CCameraAnimationModifierSoundTrigger : public ICameraAnimationModifier protected: std::string SoundName; std::string SoundPos; + NLMISC::CSheetId SoundId; public: CCameraAnimationModifierSoundTrigger() { SoundName = ""; SoundPos = ""; + SoundId = NLMISC::CSheetId::Unknown; } virtual bool parseModifier(const NLLIGO::IPrimitive* prim, const std::string& filename) @@ -80,6 +84,12 @@ public: return false; } SoundName = value; + SoundId = NLMISC::CSheetId(SoundName); + if (SoundId == NLMISC::CSheetId::Unknown) + { + nlwarning(" sheetid not found for sound name %s in the basic modifier in primitive : %s", SoundName.c_str(), filename.c_str()); + return false; + } // We get the sound position if (!prim->getPropertyByName("sound_position", value)) { diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp index 6a052f0d0..5f1519fec 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp @@ -5449,6 +5449,13 @@ class CMissionActionSoundTrigger : public IMissionAction else _SoundPosition = ""; + _SoundId = NLMISC::CSheetId(_SoundName); + if (_SoundId == NLMISC::CSheetId::Unknown) + { + MISLOGSYNTAXERROR("sound_trigger action: sheetid not found"); + return false; + } + return ret; } @@ -5460,6 +5467,7 @@ class CMissionActionSoundTrigger : public IMissionAction }; std::string _SoundName; std::string _SoundPosition; + NLMISC::CSheetId _SoundId; MISSION_ACTION_GETNEWPTR(CMissionActionSoundTrigger) };