alias addtolist "qc_cmd_svmenu addtolist ${* ?}" // Add a string to a cvar
alias dumpcommands "qc_cmd_svmenu dumpcommands ${* ?}" // Dump all commands on the program to *_cmd_dump.txt
alias maplist "qc_cmd_svmenu maplist ${* ?}" // Automatic control of maplist
+alias nextframe "qc_cmd_svmenu nextframe ${* ?}" // do something next frame
alias removefromlist "qc_cmd_svmenu removefromlist ${* ?}" // Remove a string from a cvar
alias rpn "qc_cmd_svmenu rpn ${* ?}" // RPN calculator
//alias settemp "qc_cmd_svmenu settemp ${* ?}" // Temporarily set a value to a cvar which is restored later
// rcon server commands
// ======================
rcon_secure 1
-set rcon_restricted_commands "restart fraglimit chmap gotomap endmatch reducematchtime extendmatchtime allready kick kickban \"sv_cmd bans\" \"sv_cmd unban *\" status \"sv_cmd teamstatus\" movetoauto movetored movetoblue movetoyellow movetopink"
\ No newline at end of file
+set rcon_restricted_commands "restart fraglimit chmap gotomap endmatch reducematchtime extendmatchtime allready kick kickban \"sv_cmd bans\" \"sv_cmd unban *\" status \"sv_cmd teamstatus\" movetoauto movetored movetoblue movetoyellow movetopink"
{
if not(isdemo())
{
- localcmd("\n_cl_hook_gamestart ", MapInfo_Type_ToString(gametype), "\n");
+ if(!(calledhooks & HOOK_START))
+ localcmd("\n_cl_hook_gamestart ", MapInfo_Type_ToString(gametype), "\n");
calledhooks |= HOOK_START;
}
}
vector vf_size, vf_min;
float a;
+ execute_next_frame();
+
++framecount;
hud = getstati(STAT_HUD);
// Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
return FALSE;
-}
\ No newline at end of file
+}
}
}
+void GenericCommand_nextframe(float request, float arguments, string command)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ queue_to_execute_next_frame(substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " command..."));
+ print(" Where command will be executed next frame of this VM\n");
+ return;
+ }
+ }
+}
+
void GenericCommand_removefromlist(float request, float argc)
{
switch(request)
GENERIC_COMMAND("addtolist", GenericCommand_addtolist(request, arguments), "Add a string to a cvar") \
GENERIC_COMMAND("dumpcommands", GenericCommand_dumpcommands(request), "Dump all commands on the program to *_cmd_dump.txt") \
GENERIC_COMMAND("maplist", GenericCommand_maplist(request, arguments), "Automatic control of maplist") \
+ GENERIC_COMMAND("nextframe", GenericCommand_nextframe(request, arguments, command), "Execute the given command next frame of this VM") \
GENERIC_COMMAND("removefromlist", GenericCommand_removefromlist(request, arguments), "Remove a string from a cvar") \
GENERIC_COMMAND("rpn", GenericCommand_rpn(request, arguments, command), "RPN calculator") \
GENERIC_COMMAND("settemp", GenericCommand_settemp(request, arguments), "Temporarily set a value to a cvar which is restored later") \
// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
#define CMD_Write(s) fputs(fh, s)
#define CMD_Write_Alias(execute,command,description) CMD_Write(sprintf("alias %-20s \"%-13s %-20s ${* ?}\" // %s\n", command, execute, command, description))
-void GenericCommand_macro_write_aliases(float fh);
\ No newline at end of file
+void GenericCommand_macro_write_aliases(float fh);
return servertime - dt;
}
#endif
+
+string to_execute_next_frame;
+void execute_next_frame()
+{
+ if(to_execute_next_frame)
+ {
+ localcmd("\n", to_execute_next_frame, "\n");
+ strunzone(to_execute_next_frame);
+ to_execute_next_frame = string_null;
+ }
+}
+void queue_to_execute_next_frame(string s)
+{
+ if(to_execute_next_frame)
+ {
+ s = strcat(s, "\n", to_execute_next_frame);
+ strunzone(to_execute_next_frame);
+ }
+ to_execute_next_frame = strzone(s);
+}
#ifdef CSQC
float ReadApproxPastTime();
#endif
+
+// execute-stuff-next-frame subsystem
+void execute_next_frame();
+void queue_to_execute_next_frame(string s);
float t;
float realFrametime;
+ execute_next_frame();
+
menuMouseMode = cvar("menu_mouse_absolute");
if (anim)
entity SelectSpawnPoint (float anypoint);
void StartFrame (void)
{
+ execute_next_frame();
+
remove = remove_unsafely; // not during spawning!
serverprevtime = servertime;
servertime = time;