diff --git a/src/fragglescript/t_func.cpp b/src/fragglescript/t_func.cpp index 7cd599b11..4670807e7 100644 --- a/src/fragglescript/t_func.cpp +++ b/src/fragglescript/t_func.cpp @@ -2677,13 +2677,13 @@ void FParser::SF_PlayerWeapon() if (playernum==-1) return; if (weaponnum<0 || weaponnum>9) { - script_error("weaponnum out of range! %s\n", weaponnum); + script_error("weaponnum out of range! %d\n", weaponnum); return; } PClassWeapon * ti = static_cast(PClass::FindActor(WeaponNames[weaponnum])); if (!ti) { - script_error("incompatibility in playerweapon\n", weaponnum); + script_error("incompatibility in playerweapon %d\n", weaponnum); return; } @@ -2758,13 +2758,13 @@ void FParser::SF_PlayerSelectedWeapon() if (weaponnum<0 || weaponnum>=9) { - script_error("weaponnum out of range! %s\n", weaponnum); + script_error("weaponnum out of range! %d\n", weaponnum); return; } PClassWeapon * ti = static_cast(PClass::FindActor(WeaponNames[weaponnum])); if (!ti) { - script_error("incompatibility in playerweapon\n", weaponnum); + script_error("incompatibility in playerweapon %d\n", weaponnum); return; } diff --git a/src/g_doomedmap.cpp b/src/g_doomedmap.cpp index b3aa966c3..6d7ba6796 100644 --- a/src/g_doomedmap.cpp +++ b/src/g_doomedmap.cpp @@ -246,7 +246,7 @@ void FMapInfoParser::ParseDoomEdNums() } if (error > 0) { - sc.ScriptError("%d errors encountered in DoomEdNum definition"); + sc.ScriptError("%d errors encountered in DoomEdNum definition", error); } } diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index 8e5750660..8948de223 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -7493,7 +7493,7 @@ isresolved: else { // Todo: If this is a qualified call to a parent class function, let it through (but this needs to disable virtual calls later.) - ScriptPosition.Message(MSG_ERROR, "Qualified member call to parent class not yet implemented\n", cls->TypeName.GetChars(), MethodName.GetChars()); + ScriptPosition.Message(MSG_ERROR, "Qualified member call to parent class %s::%s is not yet implemented\n", cls->TypeName.GetChars(), MethodName.GetChars()); delete this; return nullptr; } @@ -7897,7 +7897,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx) // For a reference argument the types must match 100%. if (type != ArgList[i]->ValueType) { - ScriptPosition.Message(MSG_ERROR, "Type mismatch in reference argument", Function->SymbolName.GetChars()); + ScriptPosition.Message(MSG_ERROR, "Type mismatch in reference argument %s", Function->SymbolName.GetChars()); x = nullptr; } else @@ -8346,7 +8346,7 @@ FxExpression *FxGetDefaultByType::Resolve(FCompileContext &ctx) { // this is the ugly case. We do not know what we have and cannot do proper type casting. // For now error out and let this case require explicit handling on the user side. - ScriptPosition.Message(MSG_ERROR, "GetDefaultByType() requires an actor class type", static_cast(Self)->GetValue().GetString().GetChars()); + ScriptPosition.Message(MSG_ERROR, "GetDefaultByType() requires an actor class type, but got %s", static_cast(Self)->GetValue().GetString().GetChars()); delete this; return nullptr; } diff --git a/src/scripting/thingdef.cpp b/src/scripting/thingdef.cpp index 5d2d251a9..355cc87f3 100644 --- a/src/scripting/thingdef.cpp +++ b/src/scripting/thingdef.cpp @@ -272,7 +272,7 @@ static void CheckForUnsafeStates(PClassActor *obj) // If an unsafe function (i.e. one that accesses user variables) is being detected, print a warning once and remove the bogus function. We may not call it because that would inevitably crash. auto owner = FState::StaticFindStateOwner(state); GetStateSource(state).Message(MSG_ERROR, TEXTCOLOR_RED "Unsafe state call in state %s.%d which accesses user variables, reached by %s.%s.\n", - owner->TypeName.GetChars(), state - owner->OwnedStates, obj->TypeName.GetChars(), FName(*test).GetChars()); + owner->TypeName.GetChars(), int(state - owner->OwnedStates), obj->TypeName.GetChars(), FName(*test).GetChars()); } state = state->NextState; } diff --git a/src/scripting/thingdef_properties.cpp b/src/scripting/thingdef_properties.cpp index 9eb050a83..e318a9806 100644 --- a/src/scripting/thingdef_properties.cpp +++ b/src/scripting/thingdef_properties.cpp @@ -525,7 +525,7 @@ DEFINE_PROPERTY(skip_super, 0, Actor) if (info->Size != actorclass->Size) { bag.ScriptPosition.Message(MSG_OPTERROR, - "'skip_super' is only allowed in subclasses of AActor with no additional fields and will be ignored.", info->TypeName.GetChars()); + "'skip_super' is only allowed in subclasses of AActor with no additional fields and will be ignored in type %s.", info->TypeName.GetChars()); return; } if (bag.StateSet) diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index c4c524817..d95e910ae 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -1323,7 +1323,7 @@ bool ZCCCompiler::CompileFields(PStruct *type, TArray &Fiel } else if (hasnativechildren) { - Error(field, "Cannot add field %s to %s. %s has native children which means it size may not change.", type->TypeName.GetChars(), fd->FieldSize, FName(name->Name).GetChars()); + Error(field, "Cannot add field %s to %s. %s has native children which means it size may not change.", FName(name->Name).GetChars(), type->TypeName.GetChars(), FName(name->Name).GetChars()); } else {