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

Function LGSTriggers

Descent3/loadstate.cpp:630–661  ·  view source on GitHub ↗

loads in and sets these triggers

Source from the content-addressed store, hash-verified

628
629// loads in and sets these triggers
630int LGSTriggers(CFILE *fp) {
631 int16_t i, n_trigs = 0;
632
633 gs_ReadShort(fp, n_trigs);
634 if (n_trigs != (int16_t)Num_triggers) {
635 Int3();
636 return LGS_CORRUPTLEVEL;
637 }
638
639 for (i = 0; i < n_trigs; i++) {
640
641 // must free current trigger script if there's one allocated.
642 FreeTriggerScript(&Triggers[i]);
643
644 gs_ReadShort(fp, Triggers[i].flags);
645 gs_ReadShort(fp, Triggers[i].activator);
646
647 // read script info
648 //@@ script_info script;
649 //@@
650 //@@ scrmem = LGSScript(fp, &script, &is_scripted, &scrmemsize);
651 //@@ if (is_scripted) {
652 //@@ ReinitTriggerScripts(&Triggers[i], &script, scrmemsize, scrmem);
653 //@@ }
654 //@@ if (scrmem)
655 //@@ delete[] scrmem;
656 //@@ script.set_name(NULL);
657 //@@ script.set_parms(0, NULL);
658 }
659
660 return LGS_OK;
661}
662
663struct old_vis_attach_info {
664 int obj_handle, dest_objhandle;

Callers 2

LoadGameStateFunction · 0.85
DemoReadHeaderFunction · 0.85

Calls 1

FreeTriggerScriptFunction · 0.85

Tested by

no test coverage detected