========================================================================== Starts a new actor definition ==========================================================================
| 1042 | // |
| 1043 | //========================================================================== |
| 1044 | static 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 |
no test coverage detected