X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=aa5146419a0be981ff96246e70112d3dc47f83fc;hp=bc0b49ca027ece50fb41bbccc35723b3252886d7;hb=7a450de6b250eccb737d4c428b634496b933e4ff;hpb=98eba9cd95e1b0bd3e3411a756b81a12f5997dad diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index bc0b49ca02..aa5146419a 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -522,6 +522,22 @@ float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still ne return t; } +void weaponarena_available_update(entity this) +{ + if(!weaponsInMap) + { + // if no weapons are available, just fall back to most weapons arena + FOREACH(Weapons, it != WEP_Null, { + if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & WEP_FLAG_HIDDEN)) + g_weaponarena_weapons |= (it.m_wepset); + }); + start_weapons = g_weaponarena_weapons; + return; + } + g_weaponarena_weapons |= weaponsInMap; + start_weapons = g_weaponarena_weapons; +} + void readplayerstartcvars() { float i, t; @@ -587,6 +603,18 @@ void readplayerstartcvars() g_weaponarena_weapons |= (it.m_wepset); }); } + else if (s == "available") + { + g_weaponarena = 2; + g_weaponarena_list = "Most Weapons"; + // include weapons the player would start with + FOREACH(Weapons, it != WEP_Null, { + int w = want_weapon(it, false); + if(w & 1) + g_weaponarena_weapons |= (it.m_wepset); + }); + InitializeEntity(NULL, weaponarena_available_update, INITPRIO_FINDTARGET); + } else if (s == "none") { g_weaponarena = 1;