mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 16:51:31 +00:00
- use a separate exception type for reporting errors from FraggleScript.
CRecoverableError is used in other parts as well and it might create interference.
This commit is contained in:
parent
f9441cd9d9
commit
967f6c0269
4 changed files with 27 additions and 5 deletions
|
@ -2014,13 +2014,13 @@ void FParser::SF_CeilingTexture(void)
|
|||
|
||||
void FParser::SF_ChangeHubLevel(void)
|
||||
{
|
||||
I_Error("FS hub system permanently disabled\n");
|
||||
script_error("FS hub system permanently disabled\n");
|
||||
}
|
||||
|
||||
// for start map: start new game on a particular skill
|
||||
void FParser::SF_StartSkill(void)
|
||||
{
|
||||
I_Error("startskill is not supported by this implementation!\n");
|
||||
script_error("startskill is not supported by this implementation!\n");
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -113,7 +113,7 @@ void FParser::NextToken()
|
|||
}
|
||||
if(!Section)
|
||||
{
|
||||
I_Error("section not found!\n");
|
||||
script_error("section not found!\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -708,6 +708,18 @@ void FParser::EvaluateExpression(svalue_t &result, int start, int stop)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void FS_Error(const char *error, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char errortext[MAX_ERRORTEXT];
|
||||
|
||||
va_start(argptr, error);
|
||||
myvsnprintf(errortext, MAX_ERRORTEXT, error, argptr);
|
||||
va_end(argptr);
|
||||
throw CFraggleScriptError(errortext);
|
||||
}
|
||||
|
||||
|
||||
void FParser::ErrorMessage(FString msg)
|
||||
{
|
||||
int linenum = 0;
|
||||
|
@ -721,7 +733,7 @@ void FParser::ErrorMessage(FString msg)
|
|||
}
|
||||
|
||||
//lineinfo.Format("Script %d, line %d: ", Script->scriptnum, linenum);
|
||||
I_Error("Script %d, line %d: %s", Script->scriptnum, linenum, msg.GetChars());
|
||||
FS_Error("Script %d, line %d: %s", Script->scriptnum, linenum, msg.GetChars());
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -251,7 +251,7 @@ void DFsScript::ParseScript(char *position)
|
|||
FParser parse(this);
|
||||
parse.Run(position, data, data + len);
|
||||
}
|
||||
catch (CRecoverableError &err)
|
||||
catch (CFraggleScriptError &err)
|
||||
{
|
||||
Printf ("%s\n", err.GetMessage());
|
||||
}
|
||||
|
|
|
@ -41,12 +41,22 @@
|
|||
#include "p_lnspec.h"
|
||||
#include "m_fixed.h"
|
||||
#include "actor.h"
|
||||
#include "doomerrors.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// This pragma saves 8kb of wasted code.
|
||||
#pragma pointers_to_members( full_generality, single_inheritance )
|
||||
#endif
|
||||
|
||||
|
||||
class CFraggleScriptError : public CDoomError
|
||||
{
|
||||
public:
|
||||
CFraggleScriptError() : CDoomError() {}
|
||||
CFraggleScriptError(const char *message) : CDoomError(message) {}
|
||||
};
|
||||
|
||||
|
||||
class DRunningScript;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue