X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fgamecommand.qc;h=8e63beecc33793b7c3611434f609953b76988a98;hb=67db774402e5812d5bde73d92606893f0443fc13;hp=af03b8348d7af30c96b0b979ec911475d35b6931;hpb=b49d3f3ffff847ec761e15fcc6285a736cddcba3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/gamecommand.qc b/qcsrc/server/gamecommand.qc index af03b8348..8e63beecc 100644 --- a/qcsrc/server/gamecommand.qc +++ b/qcsrc/server/gamecommand.qc @@ -1,5 +1,5 @@ string GotoMap(string m); -void race_DeleteTime(float pos); +void race_deleteTime(string map, float pos); float FullTraceFraction(vector a, vector mi, vector ma, vector b) { @@ -588,7 +588,7 @@ void EffectIndexDump() db_put(d, "TR_KNIGHTSPIKE", "1"); print("effect TR_KNIGHTSPIKE is ", ftos(particleeffectnum("TR_KNIGHTSPIKE")), "\n"); db_put(d, "TR_VORESPIKE", "1"); print("effect TR_VORESPIKE is ", ftos(particleeffectnum("TR_VORESPIKE")), "\n"); db_put(d, "TR_NEHAHRASMOKE", "1"); print("effect TR_NEHAHRASMOKE is ", ftos(particleeffectnum("TR_NEHAHRASMOKE")), "\n"); - db_put(d, "TR_XONOTICPLASMA", "1"); print("effect TR_XONOTICPLASMA is ", ftos(particleeffectnum("TR_XONOTICPLASMA")), "\n"); + db_put(d, "TR_NEXUIZPLASMA", "1"); print("effect TR_NEXUIZPLASMA is ", ftos(particleeffectnum("TR_NEXUIZPLASMA")), "\n"); db_put(d, "TR_GLOWTRAIL", "1"); print("effect TR_GLOWTRAIL is ", ftos(particleeffectnum("TR_GLOWTRAIL")), "\n"); db_put(d, "SVC_PARTICLE", "1"); print("effect SVC_PARTICLE is ", ftos(particleeffectnum("SVC_PARTICLE")), "\n"); @@ -651,6 +651,7 @@ void GameCommand(string command) print(" radarmap [--force] [--quit | --loop] [sharpness]\n"); print(" bbox\n"); print(" cvar_changes\n"); + print(" cvar_purechanges\n"); print(" find classname\n"); GameCommand_Vote("help", world); GameCommand_Ban("help"); @@ -800,16 +801,15 @@ void GameCommand(string command) bprint("That command can only be used in a team-based gamemode.\n"); return; } - if(argv(0) == "movetoteam") - if(argc == 3 || argc == 4) { -// sv_cmd movetoteam player_id team_colour -// sv_cmd movetoteam player_id team_colour type_of_move + if(argv(0) == "movetoteam") if(argc == 3 || argc == 4) { + // sv_cmd movetoteam player_id team_colour + // sv_cmd movetoteam player_id team_colour type_of_move -// type of move -// 0 (00) automove centerprint, admin message -// 1 (01) automove centerprint, no admin message -// 2 (10) no centerprint, admin message -// 3 (11) no centerprint, no admin message + // type of move + // 0 (00) automove centerprint, admin message + // 1 (01) automove centerprint, no admin message + // 2 (10) no centerprint, admin message + // 3 (11) no centerprint, no admin message if(!teams_matter) { // death match print("Currently not playing a team game\n"); @@ -824,7 +824,7 @@ void GameCommand(string command) return; } - client = edict_num(entno); + client = edict_num(entno); // player entity is not a client if not(client.flags & FL_CLIENT) { @@ -834,43 +834,52 @@ void GameCommand(string command) // find the team to move the player to float team_colour; + float save; + + save = client.team_forced; + client.team_forced = 0; team_colour = ColourToNumber(argv(2)); if(team_colour == client.team) { // player already on the team print("Player ", argv(1), " (", client.netname, ") is already on the ", ColoredTeamName(client.team), "\n"); + // keep the forcing undone return; } else if(team_colour == 0) // auto team team_colour = NumberToTeamNumber(FindSmallestTeam(client, FALSE)); + else + CheckAllowedTeams(client); + + client.team_forced = save; switch(team_colour) { case COLOR_TEAM1: if(c1 == -1) { print("Sorry, there isn't a red team\n"); return; - } - break; + } + break; case COLOR_TEAM2: if(c2 == -1) { print("Sorry, there isn't a blue team\n"); - return; - } - break; + return; + } + break; case COLOR_TEAM3: if(c3 == -1) { print("Sorry, there isn't a yellow team\n"); return; } - break; + break; case COLOR_TEAM4: if(c4 == -1) { print("Sorry, there isn't a pink team\n"); return; } - break; + break; default: print("Sorry, team ", argv(2), " doesn't exist\n"); @@ -878,6 +887,7 @@ void GameCommand(string command) } print("Player ", argv(1), " (", client.netname, ") has been moved to the ", ColoredTeamName(team_colour), "\n"); + client.team_forced = 0; MoveToTeam(client, team_colour, 6, stof(argv(3))); return; @@ -912,6 +922,11 @@ void GameCommand(string command) print(cvar_changes); return; } + if (argv(0) == "cvar_purechanges") + { + print(cvar_purechanges); + return; + } if (argv(0) == "find") if(argc == 2) { for(client = world; (client = find(client, classname, argv(1))); ) @@ -924,6 +939,11 @@ void GameCommand(string command) print(records_reply[i]); return; } + if (argv(0) == "ladder") + { + print(ladder_reply); + return; + } if (argv(0) == "rankings") { strunzone(rankings_reply); @@ -951,6 +971,7 @@ void GameCommand(string command) if(argv(0) == "debug_shotorg") { debug_shotorg = stov(argv(1)); + debug_shotorg_y = -debug_shotorg_y; return; } @@ -960,15 +981,25 @@ void GameCommand(string command) if(argv(1) == "w") setmodel(e, (nextent(world)).weaponentity.model); else + { + precache_model(argv(1)); setmodel(e, argv(1)); + } e.frame = stof(argv(2)); - i = gettagindex(e, argv(3)); + if(substring(argv(3), 0, 1) == "#") + i = stof(substring(argv(3), 1, -1)); + else + i = gettagindex(e, argv(3)); if(i) { v = gettaginfo(e, i); - print("model ", e.model, " frame ", ftos(e.frame), " tag ", argv(3)); - print(" index = ", ftos(i)); + print("model ", e.model, " frame ", ftos(e.frame), " tag ", gettaginfo_name); + print(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n"); print(" vector = ", ftos(v_x), " ", ftos(v_y), " ", ftos(v_z), "\n"); + print(" offset = ", ftos(gettaginfo_offset_x), " ", ftos(gettaginfo_offset_y), " ", ftos(gettaginfo_offset_z), "\n"); + print(" forward = ", ftos(gettaginfo_forward_x), " ", ftos(gettaginfo_forward_y), " ", ftos(gettaginfo_forward_z), "\n"); + print(" right = ", ftos(gettaginfo_right_x), " ", ftos(gettaginfo_right_y), " ", ftos(gettaginfo_right_z), "\n"); + print(" up = ", ftos(gettaginfo_up_x), " ", ftos(gettaginfo_up_y), " ", ftos(gettaginfo_up_z), "\n"); if(argc >= 6) { v_y = -v_y; @@ -1329,7 +1360,22 @@ void GameCommand(string command) } if(argv(0) == "delrec") { - race_DeleteTime(stof(argv(1))); + if(argv(2) != "") + race_deleteTime(argv(2), stof(argv(1))); + else + race_deleteTime(GetMapname(), stof(argv(1))); + + return; + } + + if(argv(0) == "showtraceline") + { + vector src, dst; + src = stov(argv(1)); + dst = stov(argv(2)); + traceline(src, dst, MOVE_NORMAL, world); + trailparticles(world, particleeffectnum("TR_NEXUIZPLASMA"), src, trace_endpos); + trailparticles(world, particleeffectnum("TR_CRYLINKPLASMA"), trace_endpos, dst); return; }