diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 3f2c656b3..c15a3f0fb 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -90,6 +90,7 @@ #include "game_share/position_or_entity_type.h" #include "nel/misc/vector.h" #include "nel/misc/entity_id.h" +#include "entity_cl.h" #define OLD_STRING_SYSTEM @@ -3576,12 +3577,20 @@ void impulsePlaySoundTrigger(NLMISC::CBitMemStream& impulse) SoundMngr->spawnSource(SoundId, SoundPosition.getPosition()); else { - NLMISC::CVector pos; + NLMISC::CVectorD pos; TDataSetIndex compressedIndex = SoundPosition.getEntityId(); - - - SoundMngr->spawnSource(SoundId, pos); + CEntityCL *entity = EntitiesMngr.getEntityByCompressedIndex(compressedIndex); + if (!entity) + { + nlwarning(" invalid entity with compressed id %d", compressedIndex); + return; + } + else + { + pos = entity->pos(); + SoundMngr->spawnSource(SoundId, pos); + } } } diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/position_or_entity_type_helper.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/position_or_entity_type_helper.cpp index 0a9742f56..86bc9db38 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/position_or_entity_type_helper.cpp +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/position_or_entity_type_helper.cpp @@ -15,6 +15,8 @@ // along with this program. If not, see . // + + #include "camera_animation_manager/position_or_entity_type_helper.h" #include "monitor_service/mirrors.h" #include "game_share/mirror.h"