From: Mario Date: Sat, 9 Jun 2018 15:27:39 +0000 (+1000) Subject: Move an assault constant into the assault file X-Git-Tag: xonotic-v0.8.5~2099 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=15560a4a494efe42e0e5fa69a628eebc11d97fc7;p=xonotic%2Fxonotic-data.pk3dir.git Move an assault constant into the assault file --- diff --git a/qcsrc/server/constants.qh b/qcsrc/server/constants.qh index 86ed86da1..f98d586fb 100644 --- a/qcsrc/server/constants.qh +++ b/qcsrc/server/constants.qh @@ -17,5 +17,3 @@ const int RESPAWN_DENY = 4; #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT) const int NUM_PLAYERSKINS_TEAMPLAY = 3; - -const int ASSAULT_VALUE_INACTIVE = 1000; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index a09aec0f5..bdd226b5c 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -198,10 +198,10 @@ string NearestLocation(vector p) return ret; } -string AmmoNameFromWeaponentity(entity wpn) +string AmmoNameFromWeaponentity(Weapon wep) { string ammoitems = "batteries"; - switch ((wpn.m_weapon).ammo_type) + switch (wep.ammo_type) { case RESOURCE_SHELLS: ammoitems = ITEM_Shells.m_name; break; case RESOURCE_BULLETS: ammoitems = ITEM_Bullets.m_name; break; @@ -266,7 +266,7 @@ string formatmessage(entity this, string msg) case "y": replacement = NearestLocation(cursor); break; case "d": replacement = NearestLocation(this.death_origin); break; case "w": replacement = ((this.(weaponentity).m_weapon == WEP_Null) ? ((this.(weaponentity).m_switchweapon == WEP_Null) ? Weapons_from(this.(weaponentity).cnt) : this.(weaponentity).m_switchweapon) : this.(weaponentity).m_weapon).m_name; break; - case "W": replacement = AmmoNameFromWeaponentity(this.(weaponentity)); break; + case "W": replacement = AmmoNameFromWeaponentity(this.(weaponentity).m_weapon); break; case "x": replacement = ((cursor_ent.netname == "" || !cursor_ent) ? "nothing" : cursor_ent.netname); break; case "s": replacement = ftos(vlen(this.velocity - this.velocity_z * '0 0 1')); break; case "S": replacement = ftos(vlen(this.velocity)); break; diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qh b/qcsrc/server/mutators/mutator/gamemode_assault.qh index ea714e6a2..15d3a65ad 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qh +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qh @@ -2,6 +2,8 @@ #include "../gamemode.qh" +const int ASSAULT_VALUE_INACTIVE = 1000; + const int ST_ASSAULT_OBJECTIVES = 1; REGISTER_MUTATOR(as, false)