From: TimePath Date: Fri, 4 Dec 2015 06:43:41 +0000 (+1100) Subject: debug: bufstr_get command X-Git-Tag: xonotic-v0.8.2~1559 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a1e8af156f7664031b7979ee31f4a5dd1e2a14a3;p=xonotic%2Fxonotic-data.pk3dir.git debug: bufstr_get command --- diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index 25dc11d1c..5ead52479 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -111,4 +111,26 @@ bool autocvar_debugdraw; } #endif +GENERIC_COMMAND(bufstr_get, "Examine a string buffer object") +{ + switch (request) + { + case CMD_REQUEST_COMMAND: + { + int bufhandle = stof(argv(1)); + int string_index = stof(argv(2)); + string s = bufstr_get(bufhandle, string_index); + LOG_INFOF("%s\n", s); + return; + } + + default: + case CMD_REQUEST_USAGE: + { + LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index")); + return; + } + } +} + #endif