Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove "DECORATE" from error string, print warning count, allow treating warnings as errors #2859

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/scripting/backend/vmbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "filesystem.h"

CVAR(Bool, strictdecorate, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
CVAR(Bool, warningstoerrors, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)

EXTERN_CVAR(Bool, vm_jit)
EXTERN_CVAR(Bool, vm_jit_aot)
Expand Down
22 changes: 21 additions & 1 deletion src/scripting/thingdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static TMap<FState *, FScriptPosition> StateSourceLines;
static FScriptPosition unknownstatesource("unknown file", 0);

EXTERN_CVAR(Bool, strictdecorate);
EXTERN_CVAR(Bool, warningstoerrors);

//==========================================================================
//
Expand Down Expand Up @@ -464,8 +465,27 @@ void LoadActors()

if (FScriptPosition::ErrorCounter > 0)
{
I_Error("%d errors while parsing DECORATE scripts", FScriptPosition::ErrorCounter);
if (FScriptPosition::WarnCounter > 0)
{
I_Error("%d errors, %d warnings while parsing scripts", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter);
}
else
{
I_Error("%d errors while parsing scripts", FScriptPosition::ErrorCounter);
}
}
else if (FScriptPosition::WarnCounter > 0)
{
if(warningstoerrors)
{
I_Error("%d warnings while parsing scripts\n", FScriptPosition::WarnCounter);
}
else
{
Printf(TEXTCOLOR_ORANGE "%d warnings while parsing scripts\n", FScriptPosition::WarnCounter);
}
}

FScriptPosition::ResetErrorCounter();
// AllActorClasses hasn'T been set up yet.
for (int i = PClass::AllClasses.Size() - 1; i >= 0; i--)
Expand Down