MCPcopy Create free account
hub / github.com/arx/ArxLibertatis / LaunchScriptCheck

Function LaunchScriptCheck

Sources/DANAE/ARX_Script.cpp:4247–5800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4245}
4246extern long SYNTAXCHECKING;
4247long LaunchScriptCheck(EERIE_SCRIPT * es, INTERACTIVE_OBJ * io)
4248{
4249 return 1;
4250
4251 if (SYNTAXCHECKING == 0) return 1;
4252
4253 if (io->ioflags & IO_FREEZESCRIPT) return 1;
4254
4255 long errors = 0;
4256 long warnings = 0;
4257 long stoppingdebug = 0;
4258 long brackets = 0;
4259 char errstring[65535];
4260 char tem[256];
4261
4262 if (io == NULL) return 1;
4263
4264 if (es == NULL) return 1;
4265
4266 if (!es->data) return 1;
4267
4268 if (es->data[0] == 0) return 1;
4269
4270 long returnvalue = 1;
4271 errstring[0] = 0;
4272 long cb = CountBrackets(es);
4273
4274 if (cb != 0)
4275 {
4276 if (cb > 0) sprintf(tem, "Global - Warning: Invalid Number of Closing Brackets. %d '}' missed\n", cb);
4277 else sprintf(tem, "Global - Warning: Invalid Number of Opening Brackets. %d '{' missed\n", -cb);
4278
4279 if (strlen(tem) + strlen(errstring) < 65480) strcat(errstring, tem);
4280 else stoppingdebug = 1;
4281
4282 warnings++;
4283 }
4284
4285 char temp[256];
4286 char temp1[64];
4287 char temp2[64];
4288 char temp3[64];
4289
4290 char curlinetext[512];
4291 long pos = 0;
4292 _CURIO = io;
4293
4294 while (((pos = GetNextWord(es, pos, temp)) >= 0) && (pos >= 0) && (pos < es->size - 1))
4295 {
4296 MakeStandard(temp);
4297 long currentline = GetCurrentLine(es, pos);
4298
4299 if (currentline == -1)
4300 {
4301 currentline = GetLastLineNum(es);
4302 }
4303
4304 memset(curlinetext, 0, 512);

Callers 1

CheckScriptSyntaxFunction · 0.85

Calls 14

CountBracketsFunction · 0.85
GetNextWordFunction · 0.85
MakeStandardFunction · 0.85
GetCurrentLineFunction · 0.85
GetLastLineNumFunction · 0.85
GetLineAsTextFunction · 0.85
GotoNextLineFunction · 0.85
iCharInFunction · 0.85
FindLabelPosFunction · 0.85
CharInFunction · 0.85
GetNextWord_InterpretedFunction · 0.85
MakeUpcaseFunction · 0.85

Tested by

no test coverage detected