From 5ef96b943bd5d024de988567ce1ef7f7ee93a387 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Tue, 23 Oct 2018 22:28:34 +0300 Subject: [PATCH] Allow a dummy StackStrF reference to be retrieved. --- shared/Base/Utility.hpp | 5 +++++ shared/Base/Utility.inl | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/shared/Base/Utility.hpp b/shared/Base/Utility.hpp index 3bd55477..3726b39d 100644 --- a/shared/Base/Utility.hpp +++ b/shared/Base/Utility.hpp @@ -108,6 +108,11 @@ SQRESULT SqThrowErrorF(HSQUIRRELVM vm, CCStr str, ...); */ bool SToB(CSStr str); +/* ------------------------------------------------------------------------------------------------ + * Retrieve a reference to a dummy StackStrF instance. +*/ +StackStrF & DummyStackStrF(); + /* ------------------------------------------------------------------------------------------------ * Retrieve a reference to a null script object. */ diff --git a/shared/Base/Utility.inl b/shared/Base/Utility.inl index 00f7bf1d..275a6820 100644 --- a/shared/Base/Utility.inl +++ b/shared/Base/Utility.inl @@ -244,6 +244,14 @@ bool SToB(CSStr str) std::strcmp(buffer, "on") == 0 || std::strcmp(buffer, "1") == 0) ? true : false; } +// ------------------------------------------------------------------------------------------------ +StackStrF & DummyStackStrF() +{ + static StackStrF s; + s.Release(); + return s; +} + // ------------------------------------------------------------------------------------------------ Object & NullObject() {