about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/editor/ed_layer_quads.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game/editor/ed_layer_quads.cpp b/src/game/editor/ed_layer_quads.cpp
index e945dd16..316d2e1f 100644
--- a/src/game/editor/ed_layer_quads.cpp
+++ b/src/game/editor/ed_layer_quads.cpp
@@ -16,6 +16,15 @@ LAYER_QUADS::~LAYER_QUADS()
 
 static void envelope_eval(float time_offset, int env, float *channels)
 {
+	if(env < 0 || env > editor.map.envelopes.len())
+	{
+		channels[0] = 0;
+		channels[1] = 0;
+		channels[2] = 0;
+		channels[3] = 0;
+		return;
+	}
+		
 	ENVELOPE *e = editor.map.envelopes[env];
 	float t = editor.animate_time+time_offset;
 	e->eval(t, channels);