X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fclanarena%2Fsv_clanarena.qc;h=696e4ee314dd937f8d499d05e9dfdd1af3c9b781;hb=275db1b1d382ef40155eeb44fae62ae5f1087029;hp=cdcb0d0d0fbedd16efa54e6a36f4d224f3a011a2;hpb=251a486c25bc0c6c831fa0673de5fa6e98cb6915;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index cdcb0d0d0..696e4ee31 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@ -62,7 +62,6 @@ int CA_GetWinnerTeam() void nades_Clear(entity player); -#define CA_ALIVE_TEAMS_OK() (Team_GetNumberOfAliveTeams() == NumTeams(ca_teams)) float CA_CheckWinner() { if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0) @@ -115,7 +114,7 @@ bool CA_CheckTeams() static int prev_missing_teams_mask; allowed_to_spawn = true; CA_count_alive_players(); - if(CA_ALIVE_TEAMS_OK()) + if (Team_GetNumberOfAliveTeams() == NumTeams(ca_teams)) { if(prev_missing_teams_mask > 0) Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); @@ -148,7 +147,7 @@ bool CA_CheckTeams() bool ca_isEliminated(entity e) { - if(e.caplayer == 1 && (IS_DEAD(e) || e.frags == FRAGS_LMS_LOSER)) + if(e.caplayer == 1 && (IS_DEAD(e) || e.frags == FRAGS_PLAYER_OUT_OF_GAME)) return true; if(e.caplayer == 0.5) return true; @@ -164,7 +163,7 @@ entity CA_SpectateNext(entity player, entity start) { if (SAME_TEAM(player, e)) return e; } - // restart from begining + // restart from the beginning for (entity e = NULL; (e = find(e, classname, STR_PLAYER)); ) { if (SAME_TEAM(player, e)) return e; @@ -253,12 +252,13 @@ entity ca_LastPlayerForTeam(entity this) { entity last_pl = NULL; FOREACH_CLIENT(IS_PLAYER(it) && it != this, { - if (!IS_DEAD(it)) - if (SAME_TEAM(this, it)) - if (!last_pl) - last_pl = it; - else - return NULL; + if (!IS_DEAD(it) && SAME_TEAM(this, it)) + { + if (!last_pl) + last_pl = it; + else + return NULL; + } }); return last_pl; } @@ -312,7 +312,7 @@ MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver) if (player.killindicator_teamchange == -2) // player wants to spectate player.caplayer = 0; if (player.caplayer) - player.frags = FRAGS_LMS_LOSER; + player.frags = FRAGS_PLAYER_OUT_OF_GAME; if (!warmup_stage) eliminatedPlayers.SendFlags |= 1; if (!player.caplayer) @@ -380,8 +380,8 @@ MUTATOR_HOOKFUNCTION(ca, PlayerDamage_SplitHealthArmor) entity frag_attacker = M_ARGV(1, entity); entity frag_target = M_ARGV(2, entity); float frag_damage = M_ARGV(7, float); - float damage_take = bound(0, M_ARGV(4, float), GetResourceAmount(frag_target, RESOURCE_HEALTH)); - float damage_save = bound(0, M_ARGV(5, float), GetResourceAmount(frag_target, RESOURCE_ARMOR)); + float damage_take = bound(0, M_ARGV(4, float), GetResource(frag_target, RES_HEALTH)); + float damage_save = bound(0, M_ARGV(5, float), GetResource(frag_target, RES_ARMOR)); float excess = max(0, frag_damage - damage_take - damage_save); @@ -483,11 +483,6 @@ MUTATOR_HOOKFUNCTION(ca, ClientCommand_Spectate) return MUT_SPECCMD_CONTINUE; } -MUTATOR_HOOKFUNCTION(ca, WantWeapon) -{ - M_ARGV(2, bool) = true; // all weapons -} - MUTATOR_HOOKFUNCTION(ca, HideTeamNagger) { return true; // doesn't work well with the whole spectator as player thing @@ -502,6 +497,8 @@ MUTATOR_HOOKFUNCTION(ca, GetPlayerStatus) MUTATOR_HOOKFUNCTION(ca, SetWeaponArena) { + LOG_INFOF("CA SetWeaponArena %s", autocvar_g_ca_weaponarena); // most weapons arena - if (M_ARGV(0, string) == "0" || M_ARGV(0, string) == "") M_ARGV(0, string) = "most"; + if (M_ARGV(0, string) == "0" || M_ARGV(0, string) == "") + M_ARGV(0, string) = autocvar_g_ca_weaponarena; }