]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_exec.c
Add hook.[ch] to VS2017 project.
[xonotic/darkplaces.git] / prvm_exec.c
index 37daaaa252f19ccf84039862a5c2cd5c9d305c40..c43fbef42791ec12bd23e9933b1a94bbe6afd8c5 100644 (file)
@@ -199,19 +199,19 @@ PRVM_PrintFunction_f
 
 ============
 */
-void PRVM_PrintFunction_f (void)
+void PRVM_PrintFunction_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog;
-       if (Cmd_Argc() != 3)
+       if (Cmd_Argc(cmd) != 3)
        {
                Con_Printf("usage: prvm_printfunction <program name> <function name>\n");
                return;
        }
 
-       if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(1))))
+       if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(cmd, 1))))
                return;
 
-       PRVM_PrintFunctionStatements(prog, Cmd_Argv(2));
+       PRVM_PrintFunctionStatements(prog, Cmd_Argv(cmd, 2));
 }
 
 /*
@@ -433,16 +433,16 @@ PRVM_CallProfile_f
 
 ============
 */
-void PRVM_CallProfile_f (void)
+void PRVM_CallProfile_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog;
-       if (Cmd_Argc() != 2)
+       if (Cmd_Argc(cmd) != 2)
        {
                Con_Print("prvm_callprofile <program name>\n");
                return;
        }
 
-       if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(1))))
+       if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(cmd, 1))))
                return;
 
        PRVM_CallProfile(prog);
@@ -454,7 +454,7 @@ PRVM_Profile_f
 
 ============
 */
-void PRVM_Profile_f (void)
+void PRVM_Profile_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog;
        int howmany;
@@ -466,21 +466,21 @@ void PRVM_Profile_f (void)
        }
 
        howmany = 1<<30;
-       if (Cmd_Argc() == 3)
-               howmany = atoi(Cmd_Argv(2));
-       else if (Cmd_Argc() != 2)
+       if (Cmd_Argc(cmd) == 3)
+               howmany = atoi(Cmd_Argv(cmd, 2));
+       else if (Cmd_Argc(cmd) != 2)
        {
                Con_Print("prvm_profile <program name>\n");
                return;
        }
 
-       if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(1))))
+       if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(cmd, 1))))
                return;
 
        PRVM_Profile(prog, howmany, 0, 0);
 }
 
-void PRVM_ChildProfile_f (void)
+void PRVM_ChildProfile_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog;
        int howmany;
@@ -492,15 +492,15 @@ void PRVM_ChildProfile_f (void)
        }
 
        howmany = 1<<30;
-       if (Cmd_Argc() == 3)
-               howmany = atoi(Cmd_Argv(2));
-       else if (Cmd_Argc() != 2)
+       if (Cmd_Argc(cmd) == 3)
+               howmany = atoi(Cmd_Argv(cmd, 2));
+       else if (Cmd_Argc(cmd) != 2)
        {
                Con_Print("prvm_childprofile <program name>\n");
                return;
        }
 
-       if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(1))))
+       if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(cmd, 1))))
                return;
 
        PRVM_Profile(prog, howmany, 0, 1);
@@ -746,7 +746,7 @@ void MVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessag
        double tm, starttm;
        prvm_vec_t tempfloat;
        // these may become out of date when a builtin is called, and are updated accordingly
-       prvm_vec_t *cached_edictsfields = prog->edictsfields;
+       prvm_vec_t *cached_edictsfields = prog->edictsfields.fp;
        unsigned int cached_entityfields = prog->entityfields;
        unsigned int cached_entityfields_3 = prog->entityfields - 3;
        unsigned int cached_entityfieldsarea = prog->entityfieldsarea;
@@ -853,7 +853,7 @@ void CLVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessa
        double tm, starttm;
        prvm_vec_t tempfloat;
        // these may become out of date when a builtin is called, and are updated accordingly
-       prvm_vec_t *cached_edictsfields = prog->edictsfields;
+       prvm_vec_t *cached_edictsfields = prog->edictsfields.fp;
        unsigned int cached_entityfields = prog->entityfields;
        unsigned int cached_entityfields_3 = prog->entityfields - 3;
        unsigned int cached_entityfieldsarea = prog->entityfieldsarea;
@@ -964,7 +964,7 @@ void PRVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessa
        double tm, starttm;
        prvm_vec_t tempfloat;
        // these may become out of date when a builtin is called, and are updated accordingly
-       prvm_vec_t *cached_edictsfields = prog->edictsfields;
+       prvm_vec_t *cached_edictsfields = prog->edictsfields.fp;
        unsigned int cached_entityfields = prog->entityfields;
        unsigned int cached_entityfields_3 = prog->entityfields - 3;
        unsigned int cached_entityfieldsarea = prog->entityfieldsarea;