From ab2089bbf35bfb7f6636d8bfb1ab45ce51836580 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 2 Jun 2016 21:19:02 +0200 Subject: [PATCH] Throw an exception if placeAt is passed an invalid direction parameter --- apps/openmw/mwscript/transformationextensions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index e9e13e74f..abde8c973 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -508,6 +508,9 @@ namespace MWScript Interpreter::Type_Integer direction = runtime[0].mInteger; runtime.pop(); + if (direction < 0 || direction > 3) + throw std::runtime_error ("invalid direction"); + if (count<0) throw std::runtime_error ("count must be non-negative");