diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-19 23:43:51 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-19 23:43:51 +0000 |
| commit | 2d4824efd5f13f14fd6dd94b1bc0dc4403519e43 (patch) | |
| tree | bf3f31644875a0af4750eda41eb8d6acec6ed704 | |
| parent | 32338b68f347f57e635304ed8289078f0b774d86 (diff) | |
| download | zcatch-2d4824efd5f13f14fd6dd94b1bc0dc4403519e43.tar.gz zcatch-2d4824efd5f13f14fd6dd94b1bc0dc4403519e43.zip | |
fixed envelope crashbug
| -rw-r--r-- | src/game/editor/ed_layer_quads.cpp | 9 |
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); |