MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / ParseActorHeader

Function ParseActorHeader

src/scripting/decorate/thingdef_parse.cpp:1044–1146  ·  view source on GitHub ↗

========================================================================== Starts a new actor definition ==========================================================================

Source from the content-addressed store, hash-verified

1042//
1043//==========================================================================
1044static PClassActor *ParseActorHeader(FScanner &sc, Baggage *bag)
1045{
1046 FName replaceName = NAME_None;
1047 bool native = false;
1048 int DoomEdNum = -1;
1049
1050 // Get actor name
1051 sc.MustGetString();
1052
1053 char *colon = strchr(sc.String, ':');
1054 if (colon != NULL)
1055 {
1056 *colon++ = 0;
1057 }
1058
1059 FName typeName = sc.String;
1060
1061 // Do some tweaking so that a definition like 'Actor:Parent' which is read as a single token is recognized as well
1062 // without having resort to C-mode (which disallows periods in actor names.)
1063 if (colon == NULL)
1064 {
1065 sc.MustGetString ();
1066 if (sc.String[0]==':')
1067 {
1068 colon = sc.String + 1;
1069 }
1070 }
1071
1072 if (colon != NULL)
1073 {
1074 if (colon[0] == 0)
1075 {
1076 sc.MustGetString ();
1077 colon = sc.String;
1078 }
1079 }
1080
1081 if (colon == NULL)
1082 {
1083 sc.UnGet();
1084 }
1085
1086 FName parentName = colon;
1087
1088 // Check for "replaces"
1089 if (sc.CheckString ("replaces"))
1090 {
1091 // Get actor name
1092 sc.MustGetString ();
1093 replaceName = sc.String;
1094
1095 if (replaceName == typeName)
1096 {
1097 sc.ScriptMessage ("Cannot replace class %s with itself", typeName.GetChars());
1098 FScriptPosition::ErrorCounter++;
1099 }
1100 }
1101

Callers 1

ParseActorFunction · 0.85

Calls 15

CreateNewActorFunction · 0.85
ResetBaggageFunction · 0.85
ValidateActorFunction · 0.85
MustGetStringMethod · 0.80
UnGetMethod · 0.80
ScriptMessageMethod · 0.80
SetCModeMethod · 0.80
ActorInfoMethod · 0.80
c_strMethod · 0.80
GetFileFullPathMethod · 0.80
ScriptErrorMethod · 0.80
GetMessageMethod · 0.80

Tested by

no test coverage detected