ec- / Quake3e

Improved Quake III Arena engine
GNU General Public License v2.0
1.19k stars 154 forks source link

Nested commands from cgame do not work if executed within multiple trap calls #198

Closed ensiform closed 1 year ago

ensiform commented 1 year ago

Related to https://github.com/ec-/Quake3e/commit/dc5bd946406d4b5c45316312443e5d97fe02835a

Example command:

static void CG_TestADSave_f( void ) {
    trap_SendConsoleCommand( "set cl_noprint 1\n" );
    trap_SendConsoleCommand( "echo Hello World\n" );
    trap_SendConsoleCommand( "stoprecord\n" );
    trap_SendConsoleCommand( "echo Hello Stopped World\n" );
    trap_SendConsoleCommand( "record test\n" );
    trap_SendConsoleCommand( "set cl_noprint 0\n" );
    trap_SendConsoleCommand( "echo Hello World Resumed\n" );
}

Output:

]\ad_save
recording to demos/test.
Stopped demo recording.]\ad_save
recording to demos/test.
Stopped demo recording.

(cl_noprint 0 was never executed and is still active at this point)

Not sure how we can work around this and keep the issue fixed that nestedcmd was intended for fixing (fbo screenshots not working with cgame screenshot binds)