MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / Step1

Method Step1

editor/ScriptMassCompile.cpp:362–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360// return true if the file was checked out for this step
361bool CheckOutGamefile(char *tempbuffer, bool show_ok_confirmation, bool report_who_has_locked);
362bool CScriptMassCompile::Step1(char *filename) {
363 if (!Network_up) {
364 SetStepText(1, "Skipping, Network 'Down'");
365 writeline("Step 1: Skipping, Due to the NO on data update");
366 return false;
367 }
368
369 if (m_NoCheckout) {
370 SetStepText(1, "Skipping, 'no checkout' option checked");
371 writeline("Step 1: Skipping, 'no checkout' option checked");
372 return false;
373 }
374
375 char source_filename[_MAX_PATH], compiled_filename[_MAX_PATH];
376
377 // make the locker
378 if (!mng_MakeLocker()) {
379 SetStepText(1, "Unable to create locker, can't check out");
380 writeline("Step 1: Can't make locker file, skipping check out");
381 return false;
382 }
383
384 // make real filenames
385 strcpy(source_filename, filename);
386 strcpy(compiled_filename, filename);
387 strcat(source_filename, ".cpp");
388 strcat(compiled_filename, ".dll");
389
390 bool found_script = false, found_compiled = false;
391 int i;
392
393 // make sure the compiled script is in the gamefiles
394 for (i = 0; i < MAX_GAMEFILES; i++) {
395 if (Gamefiles[i].used) {
396 if (!found_script && !stricmp(Gamefiles[i].name, source_filename))
397 found_script = true;
398 if (!found_compiled && !stricmp(Gamefiles[i].name, compiled_filename))
399 found_compiled = true;
400 }
401 if (found_script && found_compiled)
402 break;
403 }
404
405 if (!found_script) {
406 // ummm, this shouldn't happen
407 MessageBox("Hmmm, I couldn't find the source file for the script in the manage system...this isn't good", "Uh oh");
408 SetStepText(1, "File Not Found");
409 writeline("Step 1: Couldn't find source script in manage system");
410 mng_EraseLocker();
411 return false;
412 }
413
414 bool ntco_script = true, ntco_compiled = true;
415 if (!found_compiled)
416 ntco_compiled = false;
417
418 // see if we have these checked out
419 if (mng_FindTrackLock(source_filename, PAGETYPE_GAMEFILE) != -1)

Callers

nothing calls this directly

Calls 5

writelineFunction · 0.85
mng_MakeLockerFunction · 0.85
mng_EraseLockerFunction · 0.85
mng_FindTrackLockFunction · 0.85
CheckOutGamefileFunction · 0.85

Tested by

no test coverage detected