OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
scriptexception.h
1/*
2===========================================================================
3Copyright (C) 2015 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23// scriptexception.h: Script Exception
24
25#pragma once
26
27#include "../qcommon/str.h"
28
29class ScriptException
30{
31public:
32 str string;
33 int bAbort;
34 int bIsForAnim;
35
36private:
37 void CreateException(const char *data);
38
39public:
40 ScriptException(str text);
41 ScriptException(const char *format, ...);
42 ScriptException(char *text);
43
44 static int next_abort;
45 static int next_bIsForAnim;
46};
47
48void Error(const char *format, ...);
49
50#define ScriptDeprecated(function) throw ScriptException(function ": DEPRECATED. DON'T USE IT ANYMORE")
51#define ScriptDeprecatedAltMethod(alternative_name) gi.DPrintf("WARNING: %s: is deprecated and has been superseded by the " alternative_name " method\n", __FUNCTION__)
52#define ScriptDeprecatedAltVariable(alternative_name) gi.DPrintf("WARNING: %s: is deprecated and has been superseded by the " alternative_name " variable\n", __FUNCTION__)
53#define ScriptError throw ScriptException
Definition str.h:77