Added pluto code

This commit is contained in:
ineed bots
2023-09-01 14:57:46 -06:00
parent 30ce0ad8eb
commit 8c36a218de
5 changed files with 48 additions and 4 deletions

View File

@ -298,7 +298,12 @@ namespace codsrc
game::gScrParserPub[inst].scriptfilename = extFilename;
game:: gScrCompilePub[inst].in_ptr = "+";
game::gScrCompilePub[inst].parseBuf = sourceBuffer;
game::ScriptParse(inst, &parseData);
// pluto
game::plutonium::script_preprocess(sourceBuffer, inst, &parseData); // the pluto hook will call ScriptParse, so we dont have to
// game::ScriptParse(inst, &parseData);
//
scriptPosVar = game::GetVariable(inst, game::gScrCompilePub[inst].scriptsPos, name);
filePosId = game::GetObject(inst, scriptPosVar);
scriptCountVar = game::GetVariable(inst, game::gScrCompilePub[inst].scriptsCount, name);

View File

@ -437,7 +437,10 @@ namespace codsrc
char* buffer;
int fh;
if (*(*game::fs_game)->current.string || (*game::com_developer)->current.enabled)
// pluto
if (true)
// if (*(*game::fs_game)->current.string || (*game::com_developer)->current.enabled)
//
{
*game::statmon_related_bool = 1;
if (game::FS_FOpenFileByMode(filename, &fh, game::FS_READ) < 0)

View File

@ -1274,9 +1274,12 @@ namespace codsrc
++game::gScrVmPub[inst].function_frame;
game::gScrVmPub[inst].function_frame->fs.localId = game::gFs[inst].localId;
// pluto
game::plutonium::vm_execute_update_codepos(inst);
//
assert(game::gFs[inst].pos);
// replace func
}
void OP_ScriptFunctionCall(game::scriptInstance_t inst)
@ -4207,7 +4210,17 @@ namespace codsrc
game::Scr_ClearOutParams(inst);
startTop = &game::gScrVmPub[inst].top[-paramcount];
paramcounta = game::gScrVmPub[inst].inparamcount - paramcount;
id = game::FindEntityId(classnum, entnum, inst);
// pluto
if (classnum == -1)
{
id = entnum; // this is for level notify
}
//
else
{
id = game::FindEntityId(classnum, entnum, inst);
}
if ( id )
{
@ -4496,6 +4509,10 @@ namespace codsrc
unsigned short threadId;
const char* pos;
// pluto
game::plutonium::scr_execthread_update_codepos_func(inst, inst, &handle, &handle);
//
pos = &game::gScrVarPub[inst].programBuffer[handle];
if ( !game::gScrVmPub[inst].function_count )
@ -4537,6 +4554,10 @@ namespace codsrc
const char* pos;
game::classNum_e classnum = game::CLASS_NUM_ENTITY;
// pluto
game::plutonium::scr_execentthread_update_codepos_func(inst, &handle);
//
pos = &game::gScrVarPub[inst].programBuffer[handle];
if ( !game::gScrVmPub[inst].function_count )
@ -4576,6 +4597,10 @@ namespace codsrc
unsigned int thread;
unsigned int paramcount = 0;
// pluto
game::plutonium::scr_addexecthread_update_codepos_func(inst, &handle);
//
if ( !game::gScrVmPub[inst].function_count )
{
assert(game::gScrVmPub[inst].localVars == game::gScrVmGlob[inst].localVarsStack - 1);