From: Mario Date: Thu, 5 Feb 2015 12:36:48 +0000 (+1100) Subject: Don't remove nades that pass through weapon clips (has some side effects, but also... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4040cde491bee47b701cc454f0cd1eb38da7f347;p=xonotic%2Fxonotic-data.pk3dir.git Don't remove nades that pass through weapon clips (has some side effects, but also breaks maps like xoylent if nade is removed) --- diff --git a/qcsrc/server/mutators/gamemode_tdm.qc b/qcsrc/server/mutators/gamemode_tdm.qc index 95e6cfa2b..a2caf8b67 100644 --- a/qcsrc/server/mutators/gamemode_tdm.qc +++ b/qcsrc/server/mutators/gamemode_tdm.qc @@ -1,3 +1,13 @@ +int tdm_teams; + +// scoreboard setup +void tdm_ScoreRules(float teams) +{ + //CheckAllowedTeams(world); + ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true); + ScoreRules_basics_end(); +} + /*QUAKED spawnfunc_tdm_team (0 .5 .8) (-16 -16 -24) (16 16 32) Team declaration for TDM gameplay, this allows you to decide what team names and control point models are used in your map. Note: If you use spawnfunc_tdm_team entities you must define at least 2! However, unlike domination, you don't need to make a blank one too. @@ -29,36 +39,30 @@ void tdm_SpawnTeam (string teamname, float teamcolor) void tdm_DelayedInit() { + tdm_teams = 2; + + if(autocvar_g_tdm_teams_override < 2 || autocvar_g_tdm_teams_override > 4) + tdm_teams = autocvar_g_tdm_teams; + else + tdm_teams = autocvar_g_tdm_teams_override; + + tdm_teams = bound(2, tdm_teams, 4); + // if no teams are found, spawn defaults if(find(world, classname, "tdm_team") == world) { print("No ""tdm_team"" entities found on this map, creating them anyway.\n"); - - float numteams = autocvar_g_tdm_teams_override; - if(numteams < 2 || numteams > 4) - numteams = autocvar_g_tdm_teams; - numteams = bound(2, numteams, 4); - - tdm_SpawnTeam(NAME_TEAM_1, NUM_TEAM_1 - 1); - tdm_SpawnTeam(NAME_TEAM_2, NUM_TEAM_2 - 1); - if(numteams >= 3) - tdm_SpawnTeam(NAME_TEAM_3, NUM_TEAM_3 - 1); - if(numteams >= 4) - tdm_SpawnTeam(NAME_TEAM_4, NUM_TEAM_4 - 1); + float i; + for(i = 1; i <= tdm_teams; ++i) + tdm_SpawnTeam(Team_ColorName(Team_NumberToTeam(i)), Team_NumberToTeam(i) - 1); } + + tdm_ScoreRules(tdm_teams); } MUTATOR_HOOKFUNCTION(tdm_GetTeamCount) { ret_string = "tdm_team"; - if(find(world, classname, "tdm_team") == world) - { - // make it at least half accurate - ret_float = bound(2, ((autocvar_g_tdm_teams_override < 2) ? autocvar_g_tdm_teams : autocvar_g_tdm_teams_override), 4); - ret_string = string_null; - return false; - } - return true; } diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index 3de5608a6..388c5480e 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -552,12 +552,12 @@ void nade_boom() void nade_touch() { - float is_weapclip = 0; + /*float is_weapclip = 0; if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW) if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)) if (!(trace_dphitcontents & DPCONTENTS_OPAQUE)) - is_weapclip = 1; - if(ITEM_TOUCH_NEEDKILL() || is_weapclip) + is_weapclip = 1;*/ + if(ITEM_TOUCH_NEEDKILL()) // || is_weapclip) { remove(self); return;