about summary refs log tree commit diff
path: root/src/game/editor/ed_io.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/editor/ed_io.cpp')
-rw-r--r--src/game/editor/ed_io.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/editor/ed_io.cpp b/src/game/editor/ed_io.cpp
index c2666138..4d514051 100644
--- a/src/game/editor/ed_io.cpp
+++ b/src/game/editor/ed_io.cpp
@@ -1,5 +1,6 @@
 #include <engine/graphics.h>
 #include <engine/storage.h>
+#include <game/gamecore.h>
 #include "ed_editor.h"
 
 template<typename T>
@@ -323,7 +324,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
 		Item.m_Channels = m_lEnvelopes[e]->m_Channels;
 		Item.m_StartPoint = PointCount;
 		Item.m_NumPoints = m_lEnvelopes[e]->m_lPoints.size();
-		Item.m_Name = -1;
+		StrToInts(Item.m_aName, sizeof(Item.m_aName)/sizeof(int), m_lEnvelopes[e]->m_aName);
 		
 		df.AddItem(MAPITEMTYPE_ENVELOPE, e, sizeof(Item), &Item);
 		PointCount += Item.m_NumPoints;
@@ -552,6 +553,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName)
 				CEnvelope *pEnv = new CEnvelope(pItem->m_Channels);
 				pEnv->m_lPoints.set_size(pItem->m_NumPoints);
 				mem_copy(pEnv->m_lPoints.base_ptr(), &pPoints[pItem->m_StartPoint], sizeof(CEnvPoint)*pItem->m_NumPoints);
+				if(pItem->m_aName[0] != -1)	// compatibility with old maps
+					IntsToStr(pItem->m_aName, sizeof(pItem->m_aName)/sizeof(int), pEnv->m_aName);
 				m_lEnvelopes.add(pEnv);
 			}
 		}