From d47b0af646b7ea1d923b63ba440c97c631b953d1 Mon Sep 17 00:00:00 2001 From: suhrke Date: Wed, 5 Jul 2017 03:21:51 -0700 Subject: [PATCH] fixed bug: if unsupported ent type, returns empty vector --- ReflexToQ3/includes/EntityConverter.cpp | 4 ++++ ReflexToQ3/includes/EntityConverter.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/ReflexToQ3/includes/EntityConverter.cpp b/ReflexToQ3/includes/EntityConverter.cpp index fc10652..0d24a41 100644 --- a/ReflexToQ3/includes/EntityConverter.cpp +++ b/ReflexToQ3/includes/EntityConverter.cpp @@ -147,6 +147,10 @@ EntityConverter::convert(std::vector lines) else { throw std::runtime_error( "error: related entities must be matched prior to conversion" ); } + + // If unsupported entity, return empty vector + std::vector empty; + return empty; } diff --git a/ReflexToQ3/includes/EntityConverter.hpp b/ReflexToQ3/includes/EntityConverter.hpp index b05216f..57fa1c5 100644 --- a/ReflexToQ3/includes/EntityConverter.hpp +++ b/ReflexToQ3/includes/EntityConverter.hpp @@ -64,6 +64,7 @@ class EntityConverter * Description: Converts a single entity from reflex to xonotic format * Parameter: vector of strings lines, lines that comprise a single entity * Return: vector of strings, single entity in the converted format + * *IF entity is not supported, returns EMPTY vector * THROWS: runtime_error on malformed .map file * THROWS: runtime_error when called before related entities are matched *--------------------------------------------------------------------------------------