[nexuiz-commits] r6579 - in trunk/data/qcsrc: client common menu menu/nexuiz server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Apr 23 12:08:29 EDT 2009
Author: div0
Date: 2009-04-23 12:08:27 -0400 (Thu, 23 Apr 2009)
New Revision: 6579
Modified:
trunk/data/qcsrc/client/Main.qc
trunk/data/qcsrc/client/View.qc
trunk/data/qcsrc/client/bgmscript.qc
trunk/data/qcsrc/client/csqc_builtins.qc
trunk/data/qcsrc/client/hook.qc
trunk/data/qcsrc/client/main.qh
trunk/data/qcsrc/client/mapvoting.qc
trunk/data/qcsrc/client/miscfunctions.qc
trunk/data/qcsrc/client/projectile.qc
trunk/data/qcsrc/client/teamradar.qc
trunk/data/qcsrc/common/campaign_file.qc
trunk/data/qcsrc/common/gamecommand.qc
trunk/data/qcsrc/common/mapinfo.qc
trunk/data/qcsrc/common/util-pre.qh
trunk/data/qcsrc/common/util.qc
trunk/data/qcsrc/common/util.qh
trunk/data/qcsrc/menu/gamecommand.qc
trunk/data/qcsrc/menu/mbuiltin.qh
trunk/data/qcsrc/menu/menu.qc
trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c
trunk/data/qcsrc/menu/nexuiz/dialog_singleplayer.c
trunk/data/qcsrc/menu/nexuiz/keybinder.c
trunk/data/qcsrc/menu/nexuiz/maplist.c
trunk/data/qcsrc/menu/nexuiz/playerlist.c
trunk/data/qcsrc/menu/nexuiz/slider_resolution.c
trunk/data/qcsrc/menu/nexuiz/util.qc
trunk/data/qcsrc/menu/nexuiz/weaponslist.c
trunk/data/qcsrc/server/campaign.qc
trunk/data/qcsrc/server/cl_player.qc
trunk/data/qcsrc/server/cl_weapons.qc
trunk/data/qcsrc/server/clientcommands.qc
trunk/data/qcsrc/server/func_breakable.qc
trunk/data/qcsrc/server/g_subs.qc
trunk/data/qcsrc/server/g_triggers.qc
trunk/data/qcsrc/server/g_world.qc
trunk/data/qcsrc/server/gamecommand.qc
trunk/data/qcsrc/server/ipban.qc
trunk/data/qcsrc/server/miscfunctions.qc
trunk/data/qcsrc/server/t_items.qc
trunk/data/qcsrc/server/t_plats.qc
trunk/data/qcsrc/server/target_spawn.qc
trunk/data/qcsrc/server/vote.qc
Log:
remove all 2.4.2 compatibility code (do not merge this into 2.5 bugfix releases)
Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/Main.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -293,7 +293,7 @@
float argc;
// Tokenize String
//argc = tokenize(strMessage);
- argc = tokenize_sane(strMessage);
+ argc = tokenize_console(strMessage);
// Acquire Command
local string strCmd;
@@ -378,7 +378,7 @@
s = vtos(self.view_ofs);
s = substring(s, 1, strlen(s) - 2);
- if(tokenize_sane(s) == 3)
+ if(tokenize_console(s) == 3)
s = strcat(argv(0), " ", argv(1), " ", argv(2));
coord2d_topleft = project_3d_to_2d(self.origin + view_up * 4 - view_right * 4);
@@ -413,7 +413,7 @@
void GameCommand(string msg)
{
float argc;
- argc = tokenize_sane(msg);
+ argc = tokenize_console(msg);
if(argv(0) == "help" || argc == 0)
{
@@ -887,27 +887,6 @@
PostInit();
}
-string Net_ReadPicture()
-{
- string img;
- if(csqc_flags & CSQC_FLAG_READPICTURE)
- {
- img = ReadPicture();
- print(strcat("Got Picture: ", img, "\n"));
- } else {
- img = ReadString();
- print(strcat("^3Warning: ^7Couldn't download ", img, ". This is probably because your engine build is outdated.\n"));
- float psize, i;
- psize = ReadShort();
- // Can I be sure that ReadShort is 2 bytes and ReadLong is 4 bytes?
- // Because then this could be optimized to first get all 4-byte-groups,
- // then the remaining 2, then the remaining 1
- for(i = 0; i < psize; ++i)
- ReadByte();
- }
- return img;
-}
-
void Net_ReadRace()
{
float b;
@@ -1041,28 +1020,25 @@
return text;
keys = db_get(binddb, command);
- if(csqc_flags & CSQC_FLAG_READPICTURE)
+ if (!keys)
{
- if (!keys)
+ n = tokenize(findkeysforcommand(command)); // uses '...' strings
+ for(j = 0; j < n; ++j)
{
- n = tokenize_insane(findkeysforcommand(command)); // uses '...' strings
- for(j = 0; j < n; ++j)
+ k = stof(argv(j));
+ if(k != -1)
{
- k = stof(argv(j));
- if(k != -1)
- {
- if ("" == keys)
- keys = keynumtostring(k);
- else
- keys = strcat(keys, ", ", keynumtostring(k));
+ if ("" == keys)
+ keys = keynumtostring(k);
+ else
+ keys = strcat(keys, ", ", keynumtostring(k));
- ++l;
- if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
- }
-
+ ++l;
+ if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
}
- db_put(binddb, command, keys);
+
}
+ db_put(binddb, command, keys);
}
if ("" == keys) {
Modified: trunk/data/qcsrc/client/View.qc
===================================================================
--- trunk/data/qcsrc/client/View.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/View.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -223,18 +223,8 @@
view_set = 1;
}
- if(csqc_flags & CSQC_FLAG_COLORCODES)
- {
- // supporting engine
- vid_width = w;
- vid_height = h;
- }
- else
- {
- // non-supporting engine
- vid_width = cvar("vid_width");
- vid_height = cvar("vid_height");
- }
+ vid_width = w;
+ vid_height = h;
#ifdef BLURTEST
if(time > blurtest_time0 && time < blurtest_time1)
Modified: trunk/data/qcsrc/client/bgmscript.qc
===================================================================
--- trunk/data/qcsrc/client/bgmscript.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/bgmscript.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -199,7 +199,7 @@
// find the CURRENT line
for(;;)
{
- tokenize_sane(bufstr_get(bgmscriptbuf, e.bgmscriptline));
+ tokenize_console(bufstr_get(bgmscriptbuf, e.bgmscriptline));
if(stof(argv(1)) >= t || argv(0) != e.bgmscript)
{
e.bgmscripttime = t;
Modified: trunk/data/qcsrc/client/csqc_builtins.qc
===================================================================
--- trunk/data/qcsrc/client/csqc_builtins.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/csqc_builtins.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -98,7 +98,7 @@
void drawsetcliparea(float x, float y, float width, float height) = #324;
void drawresetcliparea(void) = #325;
float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #326;
-float stringwidth_engine(string text, float handleColors) = #327;
+float stringwidth(string text, float handleColors) = #327;
float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
@@ -281,3 +281,7 @@
string(float uselocaltime, string format, ...) strftime = #478;
float(float timer) gettime = #519;
#define GETTIME_CDTRACK 4
+
+float(string s) tokenize_console = #514;
+float(float i) argv_start_index = #515;
+float(float i) argv_end_index = #516;
Modified: trunk/data/qcsrc/client/hook.qc
===================================================================
--- trunk/data/qcsrc/client/hook.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/hook.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -71,10 +71,7 @@
tex = "particles/hook_green";
rgb = '.3 1 .3';
}
- if(csqc_flags & CSQC_FLAG_READPICTURE)
- Draw_CylindricLine(b, a, 8, tex, 0.25, random(), '1 1 1', 1, DRAWFLAG_NORMAL);
- else
- Draw_CylindricLine(b, a, 1, "", 0.25, 0, rgb, 1, DRAWFLAG_NORMAL);
+ Draw_CylindricLine(b, a, 8, tex, 0.25, random(), '1 1 1', 1, DRAWFLAG_NORMAL);
}
void Net_GrapplingHook()
Modified: trunk/data/qcsrc/client/main.qh
===================================================================
--- trunk/data/qcsrc/client/main.qh 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/main.qh 2009-04-23 16:08:27 UTC (rev 6579)
@@ -97,9 +97,7 @@
vector sbar_fontsize;
-float csqc_flags;
-#define CSQC_FLAG_READPICTURE 1
-#define CSQC_FLAG_COLORCODES 2
+//float csqc_flags;
entity playerslots[255]; // 255 is engine limit on maxclients
entity teamslots[17]; // 17 teams (including "spectator team")
Modified: trunk/data/qcsrc/client/mapvoting.qc
===================================================================
--- trunk/data/qcsrc/client/mapvoting.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/mapvoting.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -227,11 +227,9 @@
mv_preview[id] = true;
//print("^2Found...\n");
return;
- } else if(csqc_flags & CSQC_FLAG_READPICTURE) {
+ } else {
print("Requesting preview...\n");
localcmd(strcat("\ncmd mv_getpic ", ftos(id), "\n"));
- } else {
- print("^3Missing map preview - Update to a newer build to be able to see them.\n");
}
}
@@ -252,7 +250,7 @@
}
else
{
- Cmd_MapVote_MapDownload(tokenize_sane(strcat("mv_download ", ftos(id))));
+ Cmd_MapVote_MapDownload(tokenize_console(strcat("mv_download ", ftos(id))));
}
}
@@ -388,11 +386,10 @@
MapVote_UpdateVotes();
}
-string Net_ReadPicture();
void Net_MapVote_Picture()
{
float type;
type = ReadByte();
mv_preview[type] = true;
- mv_pics[type] = strzone(Net_ReadPicture());
+ mv_pics[type] = strzone(ReadPicture());
}
Modified: trunk/data/qcsrc/client/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/client/miscfunctions.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/miscfunctions.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -146,96 +146,35 @@
return tm;
}
-float stringwidth_oldfont(string text, float handleColors)
-{
- float i, len, ch, width;
- len = strlen(text);
- if(!handleColors)
- return len;
- width = 0;
- for(i = 0; i < len; ++i)
- {
- if(substring(text, i, 1) == "^")
- {
- ch = str2chr(text, i+1);
- if(ch >= '0' && ch <= '9')
- ++i;
- else if(i+4 < len && ch == 'x')
- {
- ch = str2chr(text, i+2);
- if ( (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F') )
- {
- ch = str2chr(text, i+3);
- if ( (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F') )
- {
- ch = str2chr(text, i+4);
- if ( (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F') )
- i+=4;
- else ++width;
- } else ++width;
- } else ++width;
- } else ++width;
- } else ++width;
- }
- return width;
-}
-
void CSQC_CheckEngine()
{
- /*
- registercvar("csqc_flags", "0");
- csqc_flags = cvar("csqc_flags");
- */
-
- csqc_flags = 0;
-
- if(checkextension("DP_SV_WRITEPICTURE"))
- {
- stringwidth = stringwidth_engine;
- sbar_font = FONT_USER+1;
- sbar_bigfont = FONT_USER+2;
- csqc_flags |= CSQC_FLAG_READPICTURE;
- } else {
- stringwidth = stringwidth_oldfont;
- sbar_font = FONT_DEFAULT;
- sbar_bigfont = FONT_DEFAULT;
- }
-
- if(strlennocol("^xFFF") == 0)
- csqc_flags |= CSQC_FLAG_COLORCODES;
+ sbar_font = FONT_USER+1;
+ sbar_bigfont = FONT_USER+2;
}
vector Sbar_GetFontsize(string cvarname)
{
- if(csqc_flags & CSQC_FLAG_READPICTURE)
- {
- vector v;
- v = stov(cvar_string(cvarname));
- if(v_x == 0)
- v = '8 8 0';
- if(v_y == 0)
- v_y = v_x;
- v_z = 0;
- return v;
- }
- return '8 8 0' ;
+ vector v;
+ v = stov(cvar_string(cvarname));
+ if(v_x == 0)
+ v = '8 8 0';
+ if(v_y == 0)
+ v_y = v_x;
+ v_z = 0;
+ return v;
}
float Sbar_GetWidth(float teamcolumnwidth)
{
- if(csqc_flags & CSQC_FLAG_READPICTURE)
- {
- float f;
- f = stof(cvar_string("sbar_width"));
- if(f == 0)
- f = 640;
- if(f < 320)
- f = 320;
- if(f > vid_conwidth - 2 * teamcolumnwidth)
- f = vid_conwidth - 2 * teamcolumnwidth;
- return f;
- }
- return 640;
+ float f;
+ f = stof(cvar_string("sbar_width"));
+ if(f == 0)
+ f = 640;
+ if(f < 320)
+ f = 320;
+ if(f > vid_conwidth - 2 * teamcolumnwidth)
+ f = vid_conwidth - 2 * teamcolumnwidth;
+ return f;
}
float PreviewExists(string name)
@@ -292,122 +231,10 @@
string ColorTranslateRGB(string s)
{
- if not(ColorTranslateMode & 2)
- if(csqc_flags & CSQC_FLAG_COLORCODES)
- {
- if(ColorTranslateMode & 1)
- return strdecolorize(s);
- else
- return s;
- }
-
- // running on an OLD engine!
- // must translate ^xRGB codes to regular color codes
- float i, n;
- string s2, ch, ch2;
- vector theTempColor, hsv;
- float component;
-
- s2 = "";
-
- n = strlen(s);
- for(i = 0; i < n; ++i)
- {
- ch = substring(s, i, 1);
- if(ch == "^")
- {
- ch2 = substring(s, i+1, 1);
- if(ch2 == "^")
- {
- s2 = strcat(s2, ch, ch2);
- }
- else if(ch2 == "0" || stof(ch2)) // digit?
- {
- if not(ColorTranslateMode & 1)
- s2 = strcat(s2, ch, ch2);
- }
- else if(ch2 == "x") // ^x found
- {
- theTempColor = '0 0 0';
-
- component = HEXDIGIT_TO_DEC(substring(s, i+2, 1));
- if (component >= 0) // ^xr found
- {
- theTempColor_x = component/15;
-
- component = HEXDIGIT_TO_DEC(substring(s, i+3, 1));
- if (component >= 0) // ^xrg found
- {
- theTempColor_y = component/15;
-
- component = HEXDIGIT_TO_DEC(substring(s, i+4, 1));
- if (component >= 0) // ^xrgb found
- {
- theTempColor_z = component/15;
-
- if not(ColorTranslateMode & 1)
- {
- hsv = rgb_to_hsv(theTempColor);
-
- if(hsv_y < 0.2)
- {
- if(hsv_z < 0.5)
- s2 = strcat(s2, "^0");
- else
- s2 = strcat(s2, "^7");
- }
- else
- {
- if(hsv_x < 0.6)
- s2 = strcat(s2, "^1");
- else if(hsv_x < 1.33333333333333333333)
- s2 = strcat(s2, "^3");
- else if(hsv_x < 2.5)
- s2 = strcat(s2, "^2");
- else if(hsv_x < 3.33333333333333333333)
- s2 = strcat(s2, "^5");
- else if(hsv_x < 4.5)
- s2 = strcat(s2, "^4");
- else if(hsv_x < 5.5)
- s2 = strcat(s2, "^6");
- else
- s2 = strcat(s2, "^1");
- }
- }
-
- i += 3;
- }
- else
- {
- // blue missing
- s2 = strcat(s2, substring(s, i, 4));
- i += 2;
- }
- }
- else
- {
- // green missing
- s2 = strcat(s, substring(s2, i, 3));
- i += 1;
- }
- }
- else
- {
- // red missing
- s2 = strcat(s, substring(s2, i, 2));
- }
- }
- else
- {
- s2 = strcat(s2, ch, ch2);
- }
- ++i;
- continue;
- }
- s2 = strcat(s2, ch);
- }
-
- return s2;
+ if(ColorTranslateMode & 1)
+ return strdecolorize(s);
+ else
+ return s;
}
float cvar_or(string cv, float v)
Modified: trunk/data/qcsrc/client/projectile.qc
===================================================================
--- trunk/data/qcsrc/client/projectile.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/projectile.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -166,11 +166,8 @@
void loopsound(entity e, float ch, string samp, float vol, float attn)
{
- if(csqc_flags & CSQC_FLAG_COLORCODES)
- {
- sound(e, ch, samp, vol, attn);
- e.snd_looping = 1;
- }
+ sound(e, ch, samp, vol, attn);
+ e.snd_looping = 1;
}
void Ent_RemoveProjectile()
Modified: trunk/data/qcsrc/client/teamradar.qc
===================================================================
--- trunk/data/qcsrc/client/teamradar.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/client/teamradar.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -67,18 +67,9 @@
if(fg > 0 && minimapname != "")
{
- if(csqc_flags & CSQC_FLAG_READPICTURE) // not 2.4.2
- {
- fga = 1;
- fgc = '1 1 1' * fg;
- R_BeginPolygon(minimapname, DRAWFLAG_SCREEN | DRAWFLAG_MIPMAP);
- }
- else
- {
- fga = fg;
- fgc = '1 1 1';
- R_BeginPolygon(minimapname, DRAWFLAG_ADDITIVE);
- }
+ fga = 1;
+ fgc = '1 1 1' * fg;
+ R_BeginPolygon(minimapname, DRAWFLAG_SCREEN | DRAWFLAG_MIPMAP);
if(v_flipped)
{
R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord3), yinvert(mi_pictexcoord3), fgc, fga);
Modified: trunk/data/qcsrc/common/campaign_file.qc
===================================================================
--- trunk/data/qcsrc/common/campaign_file.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/common/campaign_file.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -36,7 +36,7 @@
continue; // comment
if(lineno >= offset)
{
- entlen = tokenize_insane(l); // using insane tokenizer for CSV
+ entlen = tokenize(l); // using insane tokenizer for CSV
#define CAMPAIGN_GETARG0 if(i >= entlen)
#define CAMPAIGN_GETARG1 CAMPAIGN_GETARG0 error("syntax error in campaign file: line has not enough fields");
Modified: trunk/data/qcsrc/common/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/common/gamecommand.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/common/gamecommand.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -172,7 +172,7 @@
float i, j, f, n;
vector rgb;
string s, s2, c;
- argc = tokenize_sane(command);
+ argc = tokenize_console(command);
if(argv(0) == "help")
{
print(" rpn EXPRESSION... - a RPN calculator.\n");
@@ -646,8 +646,8 @@
// s s2 union
s2 = rpn_pop();
s = rpn_get();
- f = tokenize_sane(s);
- f2 = tokenize_sane(strcat(s, " ", s2));
+ f = tokenize_console(s);
+ f2 = tokenize_console(strcat(s, " ", s2));
// tokens 0..(f-1) represent s
// tokens f..f2 represent s2
// UNION: add all tokens to s that are in s2 but not in s
@@ -664,13 +664,13 @@
if(substring(s, 0, 1) == " ")
s = substring(s, 1, 99999);
rpn_set(s);
- tokenize_sane(command);
+ tokenize_console(command);
} else if(rpncmd == "intersection") {
// s s2 intersection
s2 = rpn_pop();
s = rpn_get();
- f = tokenize_sane(s);
- f2 = tokenize_sane(strcat(s, " ", s2));
+ f = tokenize_console(s);
+ f2 = tokenize_console(strcat(s, " ", s2));
// tokens 0..(f-1) represent s
// tokens f..f2 represent s2
// INTERSECTION: keep only the tokens from s that are also in s2
@@ -686,13 +686,13 @@
if(substring(s, 0, 1) == " ")
s = substring(s, 1, 99999);
rpn_set(s);
- tokenize_sane(command);
+ tokenize_console(command);
} else if(rpncmd == "difference") {
// s s2 difference
s2 = rpn_pop();
s = rpn_get();
- f = tokenize_sane(s);
- f2 = tokenize_sane(strcat(s, " ", s2));
+ f = tokenize_console(s);
+ f2 = tokenize_console(strcat(s, " ", s2));
// tokens 0..(f-1) represent s
// tokens f..f2 represent s2
// DIFFERENCE: keep only the tokens from s that are not in s2
@@ -707,11 +707,11 @@
if(substring(s, 0, 1) == " ")
s = substring(s, 1, 99999);
rpn_set(s);
- tokenize_sane(command);
+ tokenize_console(command);
} else if(rpncmd == "shuffle") {
// s shuffle
s = rpn_get();
- f = tokenize_sane(s);
+ f = tokenize_console(s);
for(i = 0; i < f - 1; ++i) {
// move a random item from i..f-1 to position i
@@ -723,13 +723,13 @@
for(j = i; j < f; ++j)
if(j != f2)
s = strcat(s, " ", argv(j));
- f = tokenize_sane(s);
+ f = tokenize_console(s);
}
if(substring(s, 0, 1) == " ")
s = substring(s, 1, 99999);
rpn_set(s);
- tokenize_sane(command);
+ tokenize_console(command);
} else if(rpncmd == "fexists_assert") {
s = rpn_pop();
if(!rpn_error)
Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/common/mapinfo.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -589,7 +589,7 @@
}
else
{
- n = tokenize_sane(cvar_string("g_cdtracks_remaplist"));
+ n = tokenize_console(cvar_string("g_cdtracks_remaplist"));
s = strcat(" ", cvar_string("g_cdtracks_dontusebydefault"), " ");
for(;;)
{
Modified: trunk/data/qcsrc/common/util-pre.qh
===================================================================
--- trunk/data/qcsrc/common/util-pre.qh 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/common/util-pre.qh 2009-04-23 16:08:27 UTC (rev 6579)
@@ -1,5 +0,0 @@
-#define tokenize DO_NOT_DEFINE_THIS_MONSTER_tokenize
-#define tokenizebyseparator DO_NOT_DEFINE_THIS_MONSTER_tokenizebyseparator
-#define argv DO_NOT_DEFINE_THIS_MONSTER_argv
-#define argv_start_index DO_NOT_DEFINE_THIS_MONSTER_argv_start_index
-#define argv_end_index DO_NOT_DEFINE_THIS_MONSTER_argv_end_index
Modified: trunk/data/qcsrc/common/util.qc
===================================================================
--- trunk/data/qcsrc/common/util.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/common/util.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -647,7 +647,7 @@
string neworder;
float i, n, w;
- n = tokenize_sane(order);
+ n = tokenize_console(order);
for(i = 0; i < n; ++i)
{
w = stof(argv(i));
@@ -666,7 +666,7 @@
if(complete)
{
- n = tokenize_sane(neworder);
+ n = tokenize_console(neworder);
for(w = to; w >= from; --w)
{
for(i = 0; i < n; ++i)
@@ -685,7 +685,7 @@
string s;
float w, n;
- n = tokenize_sane(order);
+ n = tokenize_console(order);
if(i >= 0 && i < n && j >= 0 && j < n && i != j)
{
@@ -885,7 +885,7 @@
{
// undo what cvar_settemp did
float n, i;
- n = tokenize_sane(cvar_string("settemp_list"));
+ n = tokenize_console(cvar_string("settemp_list"));
for(i = 0; i < n - 3; i += 3)
cvar_set(argv(i + 1), cvar_string(argv(i + 2)));
cvar_set("settemp_list", "0");
@@ -908,178 +908,6 @@
return b == median(a - eps, b, c + eps);
}
-
-
-#ifdef MENUQC
-float (string s) _tokenize_builtin = #58;
-string (float argnum) _argv_builtin = #59;
-float (string s, string sep) _tokenizebyseparator_builtin = #479;
-#else
-float (string s) _tokenize_builtin = #441;
-string (float argnum) _argv_builtin = #442;
-float (string s, string sep) _tokenizebyseparator_builtin = #479;
-#endif
-float(string s) _tokenize_console = #514;
-float(float i) _argv_start_index_builtin = #515;
-float(float i) _argv_end_index_builtin = #516;
-
-float MAX_TOKENS = 256;
-string _argv_sane_buffer[MAX_TOKENS];
-float _argv_sane_startpos[MAX_TOKENS];
-float _argv_sane_endpos[MAX_TOKENS];
-float _argc_sane;
-
-string _argv_sane(float i)
-{
- // Perl-ish -1 for the last argument
- if(i < 0)
- i = _argc_sane + i;
- return strcat("", _argv_sane_buffer[i]); // force tempstring
-}
-
-float _argv_start_index_sane(float i)
-{
- // Perl-ish -1 for the last argument
- if(i < 0)
- i = _argc_sane + i;
- return _argv_sane_startpos[i];
-}
-
-float _argv_end_index_sane(float i)
-{
- // Perl-ish -1 for the last argument
- if(i < 0)
- i = _argc_sane + i;
- return _argv_sane_endpos[i];
-}
-
-//string TOKENIZE_SANE_WHITESPACE_CHARS = "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
-string TOKENIZE_SANE_WHITESPACE_CHARS = "\x20\x0d\x0a\x09";
-string TOKENIZE_SANE_COMMENT_BREAKERS = "\x0d\x0a";
-// change this if DP changes its type to "char"!
-
-float _tokenize_sane(string s)
-{
- // This MUST match COM_ParseToken_Console!
- string com_token, tmp;
- float data;
- float end;
- float i;
-
- for(i = 0; i < _argc_sane; ++i)
- {
- if(_argv_sane_buffer[i])
- strunzone(_argv_sane_buffer[i]);
- _argv_sane_buffer[i] = string_null;
- _argv_sane_startpos[i] = 0;
- }
-
- _argc_sane = 0;
- data = 0;
- end = strlen(s);
-
- for(;;)
- {
- // skip whitespace
- for(; data < end && strstrofs(TOKENIZE_SANE_WHITESPACE_CHARS, substring(s, data, 1), 0) >= 0; ++data)
- ;
- if(data == end)
- break;
-
- if(substring(s, data, 2) == "//")
- {
- // comment
-
- // Any call to the tokenizer ALREADY assumes it's a single line, so we can safely abort if we see a comment.
- /*
- data += 2;
- while(data < end && strstrofs(TOKENIZE_SANE_COMMENT_BREAKERS, substring(s, data, 1), 0) >= 0)
- ++data;
- continue; // go to skipwhite again
- */
-
- // I'd like to simply put a "break" here, but then fteqcc says this function has unreachable code
- return _argc_sane;
- }
- else if(substring(s, data, 1) == "\"")
- {
- // quoted string
- com_token = "";
- _argv_sane_startpos[_argc_sane] = data;
- for(++data; data < end && substring(s, data, 1) != "\""; ++data)
- {
- // allow escaped " and \ case
- tmp = substring(s, data, 2);
- if(tmp == "\\\"" || tmp == "\\\\")
- ++data;
- com_token = strcat(com_token, substring(s, data, 1));
- }
- if(substring(s, data, 1) == "\"")
- ++data;
- _argv_sane_endpos[_argc_sane] = data;
- _argv_sane_buffer[_argc_sane] = strzone(com_token);
- ++_argc_sane;
- }
- else
- {
- // regular word
- com_token = "";
- _argv_sane_startpos[_argc_sane] = data;
- for(; data < end && strstrofs(TOKENIZE_SANE_WHITESPACE_CHARS, substring(s, data, 1), 0) < 0; ++data)
- com_token = strcat(com_token, substring(s, data, 1));
- _argv_sane_endpos[_argc_sane] = data;
- _argv_sane_buffer[_argc_sane] = strzone(com_token);
- ++_argc_sane;
- }
- }
-
- return _argc_sane;
-}
-
-
-
-// "sane" tokenizer
-// matching the console 1:1
-
-float tokenize_sane_force_native(string s)
-{
- argv = _argv_builtin;
- argv_start_index = _argv_start_index_builtin;
- argv_end_index = _argv_end_index_builtin;
- return _tokenize_console(s);
-}
-
-float tokenize_sane_force_emulation(string s)
-{
- argv = _argv_sane;
- argv_start_index = _argv_start_index_sane;
- argv_end_index = _argv_end_index_sane;
- return _tokenize_sane(s);
-}
-
-float tokenize_sane(string s)
-{
- if(checkextension("DP_QC_TOKENIZE_CONSOLE"))
- return tokenize_sane_force_native(s);
- return tokenize_sane_force_emulation(s);
-}
-
-float tokenize_insane(string s)
-{
- argv = _argv_builtin;
- argv_start_index = _argv_start_index_builtin;
- argv_end_index = _argv_end_index_builtin;
- return _tokenize_builtin(s);
-}
-
-float tokenizebyseparator(string s, string sep)
-{
- argv = _argv_builtin;
- argv_start_index = _argv_start_index_builtin;
- argv_end_index = _argv_end_index_builtin;
- return _tokenizebyseparator_builtin(s, sep);
-}
-
float power2of(float e)
{
return pow(2, e);
@@ -1625,7 +1453,7 @@
{
if(cvar("_allow_unacceptable_compiler_bugs"))
return;
- tokenize_sane("foo bar");
+ tokenize_console("foo bar");
if(strcat(argv(0), substring("foo bar", 4, 7 - argv_start_index(1))) == "barbar")
error("fteqcc bug introduced with revision 3178 detected. Please upgrade fteqcc to a later revision, downgrade fteqcc to revision 3177, or pester Spike until he fixes it. You can set _allow_unacceptable_compiler_bugs 1 to skip this check, but expect stuff to be horribly broken then.");
}
Modified: trunk/data/qcsrc/common/util.qh
===================================================================
--- trunk/data/qcsrc/common/util.qh 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/common/util.qh 2009-04-23 16:08:27 UTC (rev 6579)
@@ -106,19 +106,6 @@
float almost_equals(float a, float b);
float almost_in_bounds(float a, float b, float c);
-#undef tokenize
-#undef tokenizebyseparator
-#undef argv
-
-var string(float) argv;
-var float(float) argv_start_index;
-var float(float) argv_end_index;
-float tokenize_sane(string s);
-float tokenize_sane_force_emulation(string s);
-float tokenize_sane_force_native(string s);
-float tokenize_insane(string s);
-float tokenizebyseparator(string s, string sep);
-
float power2of(float e);
float log2of(float x);
Modified: trunk/data/qcsrc/menu/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/menu/gamecommand.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/gamecommand.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -34,7 +34,7 @@
void GameCommand(string theCommand)
{
float argc;
- argc = tokenize_sane(theCommand);
+ argc = tokenize_console(theCommand);
if(argv(0) == "help" || argc == 0)
{
@@ -82,7 +82,7 @@
print("SANE tokenizer:\n");
s = cvar_string("tokentest");
- n = tokenize_sane_force_builtin(s);
+ n = tokenize_console_force_builtin(s);
for(i = -n; i < n; ++i)
{
print("token ", ftos(i), ": '", argv(i), "' = ");
@@ -92,7 +92,7 @@
print("INSANE tokenizer:\n");
s = cvar_string("tokentest");
- n = tokenize_insane(s);
+ n = tokenize(s);
for(i = -n; i < n; ++i)
{
print("token ", ftos(i), ": '", argv(i), "' = ");
@@ -102,7 +102,7 @@
print("EMULATED tokenizer:\n");
s = cvar_string("tokentest");
- n = tokenize_sane_force_emulation(s);
+ n = tokenize_console_force_emulation(s);
for(i = -n; i < n; ++i)
{
print("token ", ftos(i), ": '", argv(i), "' = ");
Modified: trunk/data/qcsrc/menu/mbuiltin.qh
===================================================================
--- trunk/data/qcsrc/menu/mbuiltin.qh 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/mbuiltin.qh 2009-04-23 16:08:27 UTC (rev 6579)
@@ -337,3 +337,7 @@
return handle;
};
#endif
+
+float(string s) tokenize_console = #514;
+float(float i) argv_start_index = #515;
+float(float i) argv_end_index = #516;
Modified: trunk/data/qcsrc/menu/menu.qc
===================================================================
--- trunk/data/qcsrc/menu/menu.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/menu.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -91,7 +91,7 @@
continue;
if(substring(s, 0, 7) == "author ")
continue;
- n = tokenize_sane(s);
+ n = tokenize_console(s);
if(n >= 2)
Skin_ApplySetting(argv(0), substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
}
Modified: trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c 2009-04-23 16:08:27 UTC (rev 6579)
@@ -42,7 +42,7 @@
weaponarenastring_cvar = strzone(s);
- n = tokenize_sane(s);
+ n = tokenize_console(s);
s = "";
for(i = 0; i < n; ++i)
{
@@ -103,7 +103,7 @@
// WARNING: dirty hack. TODO clean this up by putting this behaviour in extra classes.
void loadCvarsLaserWeaponArenaWeaponButton(entity me)
{
- tokenize_sane(cvar_string("g_weaponarena"));
+ tokenize_console(cvar_string("g_weaponarena"));
me.checked = (argv(0) == me.cvarValue);
}
Modified: trunk/data/qcsrc/menu/nexuiz/dialog_singleplayer.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/dialog_singleplayer.c 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/nexuiz/dialog_singleplayer.c 2009-04-23 16:08:27 UTC (rev 6579)
@@ -28,7 +28,7 @@
{
if(substring(s, 0, 4) == "set ")
s = substring(s, 4, strlen(s) - 4);
- n = tokenize_sane(s);
+ n = tokenize_console(s);
if(argv(0) == "bot_number")
cvar_set("bot_number", argv(1));
else if(argv(0) == "skill")
Modified: trunk/data/qcsrc/menu/nexuiz/keybinder.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/keybinder.c 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/nexuiz/keybinder.c 2009-04-23 16:08:27 UTC (rev 6579)
@@ -50,7 +50,7 @@
return;
while((s = fgets(fh)))
{
- if(tokenize_sane(s) != 2)
+ if(tokenize_console(s) != 2)
continue;
Nexuiz_KeyBinds_Functions[Nexuiz_KeyBinds_Count] = strzone(argv(0));
Nexuiz_KeyBinds_Descriptions[Nexuiz_KeyBinds_Count] = strzone(argv(1));
@@ -116,7 +116,7 @@
if(func == "")
return;
- n = tokenize_insane(findkeysforcommand(func)); // uses '...' strings
+ n = tokenize(findkeysforcommand(func)); // uses '...' strings
nvalid = 0;
for(j = 0; j < n; ++j)
{
@@ -186,7 +186,7 @@
if(func == "")
return;
- n = tokenize_insane(findkeysforcommand(func)); // uses '...' strings
+ n = tokenize(findkeysforcommand(func)); // uses '...' strings
for(j = 0; j < n; ++j)
{
k = stof(argv(j));
@@ -300,7 +300,7 @@
draw_Text(me.realUpperMargin * eY + extraMargin * eX, descr, me.realFontSize, theColor, theAlpha, 0);
if(func != "")
{
- n = tokenize_insane(findkeysforcommand(func)); // uses '...' strings
+ n = tokenize(findkeysforcommand(func)); // uses '...' strings
s = "";
for(j = 0; j < n; ++j)
{
Modified: trunk/data/qcsrc/menu/nexuiz/maplist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/maplist.c 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/nexuiz/maplist.c 2009-04-23 16:08:27 UTC (rev 6579)
@@ -102,7 +102,7 @@
else
{
s = "";
- n = tokenize_sane(cvar_string("g_maplist"));
+ n = tokenize_console(cvar_string("g_maplist"));
for(i = 0; i < n; ++i)
if(argv(i) != bspname)
s = strcat(s, " ", argv(i));
@@ -210,7 +210,7 @@
s = "0";
for(i = 1; i < MapInfo_count; i *= 2)
s = strcat(s, s);
- n = tokenize_sane(cvar_string("g_maplist"));
+ n = tokenize_console(cvar_string("g_maplist"));
for(i = 0; i < n; ++i)
{
j = MapInfo_FindName(argv(i));
Modified: trunk/data/qcsrc/menu/nexuiz/playerlist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/playerlist.c 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/nexuiz/playerlist.c 2009-04-23 16:08:27 UTC (rev 6579)
@@ -51,7 +51,7 @@
for(i = 0; i < me.nItems; ++i)
{
s = bufstr_get(buf, i * PLAYERPARM_COUNT + PLAYERPARM_NAME);
- n = tokenize_sane(s);
+ n = tokenize_console(s);
if(n == 4)
{
Modified: trunk/data/qcsrc/menu/nexuiz/slider_resolution.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/slider_resolution.c 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/nexuiz/slider_resolution.c 2009-04-23 16:08:27 UTC (rev 6579)
@@ -47,7 +47,7 @@
{
if(me.value >= 0 || me.value < me.nValues)
{
- tokenize_sane(me.getIdentifier(me));
+ tokenize_console(me.getIdentifier(me));
cvar_set("vid_width", argv(0));
cvar_set("vid_height", argv(1));
cvar_set("vid_conwidth", argv(2));
Modified: trunk/data/qcsrc/menu/nexuiz/util.qc
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/util.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/nexuiz/util.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -36,7 +36,7 @@
me.saveCvars_Multi(me);
s = cvar_string(me.cvarName);
- n = tokenize_sane(me.cvarNames_Multi);
+ n = tokenize_console(me.cvarNames_Multi);
for(i = 0; i < n; ++i)
cvar_set(argv(i), s);
}
@@ -224,7 +224,7 @@
local float argc;
while(strlen((s = getextresponse())))
{
- argc = tokenize_sane(s);
+ argc = tokenize_console(s);
Item_Nex_ExtResponseSystem_Parse(argc);
}
}
Modified: trunk/data/qcsrc/menu/nexuiz/weaponslist.c
===================================================================
--- trunk/data/qcsrc/menu/nexuiz/weaponslist.c 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/menu/nexuiz/weaponslist.c 2009-04-23 16:08:27 UTC (rev 6579)
@@ -40,7 +40,7 @@
print("AUTOFIXED\n");
cvar_set("cl_weaponpriority", t);
}
- me.nItems = tokenize_sane(t);
+ me.nItems = tokenize_console(t);
drawListBox(me);
}
void WeaponsList_MoveUp_Click(entity box, entity me)
@@ -81,7 +81,7 @@
float n, i;
string s;
entity e;
- n = tokenize_sane(cvar_string("cl_weaponpriority"));
+ n = tokenize_console(cvar_string("cl_weaponpriority"));
s = "";
for(i = 0; i < n; ++i)
{
Modified: trunk/data/qcsrc/server/campaign.qc
===================================================================
--- trunk/data/qcsrc/server/campaign.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/campaign.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -136,7 +136,7 @@
{
while((l = fgets(fh)))
{
- len = tokenize_sane(l);
+ len = tokenize_console(l);
if(len != 3)
continue;
if(argv(0) != "set")
Modified: trunk/data/qcsrc/server/cl_player.qc
===================================================================
--- trunk/data/qcsrc/server/cl_player.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/cl_player.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -881,7 +881,7 @@
void PrecacheGlobalSound(string samplestring)
{
float n, i;
- tokenize_sane(samplestring);
+ tokenize_console(samplestring);
n = stof(argv(1));
if(n > 0)
{
@@ -903,7 +903,7 @@
return;
while((s = fgets(fh)))
{
- if(tokenize_sane(s) != 3)
+ if(tokenize_console(s) != 3)
{
dprint("Invalid sound info line: ", s, "\n");
continue;
@@ -939,7 +939,7 @@
return;
while((s = fgets(fh)))
{
- if(tokenize_sane(s) != 3)
+ if(tokenize_console(s) != 3)
continue;
field = GetPlayerSoundSampleField(argv(0));
if(GetPlayerSoundSampleField_notFound)
@@ -975,7 +975,7 @@
if(sample == "")
return;
- tokenize_sane(sample);
+ tokenize_console(sample);
n = stof(argv(1));
if(n > 0)
sample = strcat(argv(0), ftos(floor(random() * n + 1)), ".wav"); // randomization
Modified: trunk/data/qcsrc/server/cl_weapons.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weapons.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/cl_weapons.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -23,7 +23,7 @@
float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain)
{
float n, i, weaponwant, first_valid, prev_valid, switchtonext, switchtolast, c;
- n = tokenize_sane(weaponorder);
+ n = tokenize_console(weaponorder);
switchtonext = switchtolast = 0;
first_valid = prev_valid = 0;
Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/clientcommands.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -105,7 +105,7 @@
local float tokens, f, effectnum;
local vector start, end;
- tokens = tokenize_sane(s);
+ tokens = tokenize_console(s);
if(GameCommand_Vote(s, self)) {
return;
@@ -146,14 +146,14 @@
if(substring(argv(2), 0, 1) == "$") // undefined cvar: use the default value on the server then
{
s = strcat(substring(s, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
- tokens = tokenize_sane(s);
+ tokens = tokenize_console(s);
}
GetCvars(1);
} else if(argv(0) == "sentcvar") { // new system
if(tokens == 2) // undefined cvar: use the default value on the server then
{
s = strcat(substring(s, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
- tokens = tokenize_sane(s);
+ tokens = tokenize_console(s);
}
GetCvars(1);
} else if(argv(0) == "spectate") {
Modified: trunk/data/qcsrc/server/func_breakable.qc
===================================================================
--- trunk/data/qcsrc/server/func_breakable.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/func_breakable.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -135,7 +135,7 @@
RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, self.dmg_force, DEATH_HURTTRIGGER, world);
// now throw around the debris
- n = tokenize_sane(self.debris);
+ n = tokenize_console(self.debris);
for(i = 0; i < n; ++i)
LaunchDebris(argv(i));
@@ -202,7 +202,7 @@
// precache all the models
if (self.mdl_dead)
precache_model(self.mdl_dead);
- n = tokenize_sane(self.debris);
+ n = tokenize_console(self.debris);
for(i = 0; i < n; ++i)
precache_model(argv(i));
if(self.noise)
Modified: trunk/data/qcsrc/server/g_subs.qc
===================================================================
--- trunk/data/qcsrc/server/g_subs.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/g_subs.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -53,7 +53,7 @@
if (animfile < 0)
return '0 1 2';
line = fgets(animfile);
- c = tokenize_sane(line);
+ c = tokenize_console(line);
if (c != 3)
{
animparseerror = TRUE;
Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/g_triggers.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -1510,7 +1510,7 @@
if(time >= pl.voicescript_nextthink)
{
// get the next voice...
- n = tokenize_sane(vs.message);
+ n = tokenize_console(vs.message);
if(pl.voicescript_index < vs.cnt)
i = pl.voicescript_index * 2;
@@ -1544,7 +1544,7 @@
float i, n;
self.use = target_voicescript_use;
- n = tokenize_sane(self.message);
+ n = tokenize_console(self.message);
self.cnt = n / 2;
for(i = 0; i+1 < n; i += 2)
{
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/g_world.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -553,7 +553,7 @@
{
while((s = fgets(fd)))
{
- l = tokenize_sane(s);
+ l = tokenize_console(s);
if(l < 2)
continue;
if(argv(0) == "cd")
@@ -615,7 +615,7 @@
lsmaps_reply = strzone(strcat(lsmaps_reply, "\n"));
maplist_reply = "^7Maps in list: ";
- n = tokenize_sane(cvar_string("g_maplist"));
+ n = tokenize_console(cvar_string("g_maplist"));
for(i = 0, j = 0; i < n; ++i)
{
if(MapInfo_CheckMap(argv(i)))
Modified: trunk/data/qcsrc/server/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/server/gamecommand.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/gamecommand.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -543,7 +543,7 @@
fh = fopen("effectinfo.txt", FILE_READ);
while((s = fgets(fh)))
{
- tokenize_insane(s); // tokenize_sane would hit the loop counter :(
+ tokenize(s); // tokenize_console would hit the loop counter :(
if(argv(0) == "effect")
{
if(db_get(d, argv(1)) != "1")
@@ -580,7 +580,7 @@
entity client, e;
vector v;
float entno, i;
- argc = tokenize_sane(command);
+ argc = tokenize_console(command);
if(argv(0) == "help" || argc == 0)
{
Modified: trunk/data/qcsrc/server/ipban.qc
===================================================================
--- trunk/data/qcsrc/server/ipban.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/ipban.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -31,7 +31,7 @@
uri = strcat(uri, "&duration=", ftos(bantime));
uri = strcat(uri, "&reason=", uri_escape(reason));
- n = tokenize_sane(cvar_string("g_ban_sync_uri"));
+ n = tokenize_console(cvar_string("g_ban_sync_uri"));
if(n >= MAX_IPBAN_URIS)
n = MAX_IPBAN_URIS;
for(i = 0; i < n; ++i)
@@ -46,7 +46,7 @@
uri = strcat( "?action=unban&hostname=", uri_escape(cvar_string("hostname")));
uri = strcat(uri, "&ip=", uri_escape(ip));
- n = tokenize_sane(cvar_string("g_ban_sync_uri"));
+ n = tokenize_console(cvar_string("g_ban_sync_uri"));
if(n >= MAX_IPBAN_URIS)
n = MAX_IPBAN_URIS;
for(i = 0; i < n; ++i)
@@ -75,7 +75,7 @@
return;
}
- tokenize_sane(cvar_string("g_ban_sync_uri"));
+ tokenize_console(cvar_string("g_ban_sync_uri"));
uri = argv(id);
print("Received ban list from ", uri, ": ");
@@ -183,7 +183,7 @@
return;
if(cvar("g_ban_sync_interval") == 0) // < 0 is okay, it means "sync on level start only"
return;
- argc = tokenize_sane(cvar_string("g_ban_sync_trusted_servers"));
+ argc = tokenize_console(cvar_string("g_ban_sync_trusted_servers"));
if(argc == 0)
return;
@@ -199,7 +199,7 @@
OnlineBanList_Timeout = time + cvar("g_ban_sync_timeout");
- n = tokenize_sane(cvar_string("g_ban_sync_uri"));
+ n = tokenize_console(cvar_string("g_ban_sync_uri"));
if(n >= MAX_IPBAN_URIS)
n = MAX_IPBAN_URIS;
for(i = 0; i < n; ++i)
@@ -274,7 +274,7 @@
Ban_Delete(i);
ban_count = 0;
ban_loaded = TRUE;
- n = tokenize_sane(cvar_string("g_banned_list"));
+ n = tokenize_console(cvar_string("g_banned_list"));
if(stof(argv(0)) == 1)
{
ban_count = (n - 1) / 2;
@@ -525,7 +525,7 @@
string reason;
float reasonarg;
- argc = tokenize_sane(command);
+ argc = tokenize_console(command);
if(argv(0) == "help")
{
print(" kickban # n m p reason - kickban player n for m seconds, using mask size p (1 to 4)\n");
Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/miscfunctions.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -791,7 +791,7 @@
}
else
{
- t = tokenize_sane(s);
+ t = tokenize_console(s);
g_weaponarena_list = "";
for(i = 0; i < t; ++i)
{
Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/t_items.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -675,7 +675,7 @@
startitem_failed = TRUE;
return;
}
- t = tokenize_sane(s);
+ t = tokenize_console(s);
if(t >= 2)
{
self.team = --internalteam;
@@ -1221,7 +1221,7 @@
precache_sound("misc/poweroff.wav");
precache_sound("weapons/weaponpickup.wav");
- n = tokenize_sane(self.netname);
+ n = tokenize_console(self.netname);
for(i = 0; i < n; ++i)
{
if(argv(i) == "unlimited_ammo") self.items |= IT_UNLIMITED_AMMO;
Modified: trunk/data/qcsrc/server/t_plats.qc
===================================================================
--- trunk/data/qcsrc/server/t_plats.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/t_plats.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -1628,7 +1628,7 @@
self.nextthink = time + 0.1;
- n = floor((tokenize_sane(self.owner.netname)) / 5);
+ n = floor((tokenize_console(self.owner.netname)) / 5);
t = self.nextthink * self.owner.cnt + self.owner.phase * 360;
v = self.owner.destvec;
Modified: trunk/data/qcsrc/server/target_spawn.qc
===================================================================
--- trunk/data/qcsrc/server/target_spawn.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/target_spawn.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -32,7 +32,7 @@
entity oldactivator;
entity kt, t2, t3, t4;
- n = tokenize_sane(self.message);
+ n = tokenize_console(self.message);
self.target_spawn_activator = activator;
kt = find(world, targetname, self.killtarget);
Modified: trunk/data/qcsrc/server/vote.qc
===================================================================
--- trunk/data/qcsrc/server/vote.qc 2009-04-23 14:56:01 UTC (rev 6578)
+++ trunk/data/qcsrc/server/vote.qc 2009-04-23 16:08:27 UTC (rev 6579)
@@ -22,7 +22,7 @@
entity e;
string reason;
- tokens = tokenize_sane(vote);
+ tokens = tokenize_console(vote);
ns = "";
if(tokens >= 2)
@@ -96,13 +96,13 @@
{
float vote_argc;
entity victim;
- vote_argc = tokenize_sane(vote);
+ vote_argc = tokenize_console(vote);
if(!VoteAllowed(argv(0), cmd))
return FALSE;
// VoteAllowed tokenizes!
- vote_argc = tokenize_sane(vote);
+ vote_argc = tokenize_console(vote);
// remap chmap to gotomap (forces intermission)
if(vote_argc < 2)
@@ -111,14 +111,14 @@
if(argv(0) == "chmap")
{
vote = strcat("gotomap ", substring(vote, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
- vote_argc = tokenize_sane(vote);
+ vote_argc = tokenize_console(vote);
}
if(argv(0) == "gotomap")
{
if(!(vote = ValidateMap(substring(vote, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), e)))
return FALSE;
vote = strcat("gotomap ", vote);
- vote_argc = tokenize_sane(vote); // ValidateMap may have done some stuff to it
+ vote_argc = tokenize_console(vote); // ValidateMap may have done some stuff to it
}
// make kick and kickban votes a bit nicer (and reject them if formatted badly)
@@ -140,7 +140,7 @@
float GameCommand_Vote(string s, entity e) {
float argc;
- argc = tokenize_sane(s);
+ argc = tokenize_console(s);
if(argv(0) == "help") {
print_to(e, " vote COMMANDS ARGUMENTS. See 'vhelp' for more info.");
return TRUE;
More information about the nexuiz-commits
mailing list