From f88dabae8a611c4fd13f441abb51f0e11d6454c3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Aug 2008 10:27:16 +0000 Subject: [PATCH] BGE data conversion was making sound paths absolute, modify a copy rather then the original. --- source/gameengine/Converter/KX_ConvertActuators.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index cb2521de9a4..b1f86afa4ee 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -384,8 +384,12 @@ void BL_ConvertActuators(char* maggiename, else { /* but we need to convert the samplename into absolute pathname first */ - BLI_convertstringcode(soundact->sound->name, maggiename); - samplename = soundact->sound->name; + char fullpath[sizeof(soundact->sound->name)]; + + /* dont modify soundact->sound->name, only change a copy */ + BLI_strncpy(fullpath, soundact->sound->name, sizeof(fullpath)); + BLI_convertstringcode(fullpath, maggiename); + samplename = fullpath; /* and now we can load it */ if (soundscene->LoadSample(samplename, NULL, 0) > -1)