]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'remotes/origin/master' into TimePath/itemsys
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 3 Jul 2015 06:29:25 +0000 (16:29 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 3 Jul 2015 06:29:25 +0000 (16:29 +1000)
# Conflicts:
# qcsrc/client/main.qc
# qcsrc/client/progs.src
# qcsrc/menu/menu.qc
# qcsrc/menu/progs.src
# qcsrc/server/g_world.qc

1  2 
qcsrc/client/main.qc
qcsrc/client/progs.src
qcsrc/menu/menu.qc
qcsrc/menu/progs.src
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/progs.src
qcsrc/server/t_items.qc

diff --combined qcsrc/client/main.qc
index 0cedf8fd7ce5fdba8d5a1dcf59f1b8829f10a7f3,298bcdbefefff66e1b26993c8dd3b23a41f1e842..7648b129775afa875f38ff5e16de5339c62c3a80
  #include "waypointsprites.qh"
  
  #include "vehicles/bumblebee.qh"
- #include "vehicles/vehicles.qh"
+ #include "vehicles/all.qh"
  
  #include "weapons/projectile.qh"
  
  #include "../common/buffs.qh"
  #include "../common/deathtypes.qh"
  #include "../common/mapinfo.qh"
- #include "../common/monsters/monsters.qh"
+ #include "../common/monsters/all.qh"
  #include "../common/nades.qh"
  #include "../common/net_notice.qh"
  #include "../common/notifications.qh"
  #include "../common/stats.qh"
  #include "../common/teams.qh"
  
- #include "../common/weapons/weapons.qh"
 +#include "../common/items/all.qh"
 +
+ #include "../common/weapons/all.qh"
  
  #include "../csqcmodellib/cl_model.qh"
  #include "../csqcmodellib/interpolate.qh"
@@@ -138,7 -136,6 +138,7 @@@ void CSQC_Init(void
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
        CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
 +      CALL_ACCUMULATED_FUNCTION(RegisterItems);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
@@@ -859,7 -856,6 +859,7 @@@ void CSQC_Ent_Update(float bIsNewEntity
                case ENT_CLIENT_WARPZONE_TELEPORTED: WarpZone_Teleported_Read(bIsNewEntity); break;
                case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break;
                case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break;
 +              case ENT_CLIENT_INVENTORY: Inventory_Read(self); break;
                case ENT_CLIENT_ARC_BEAM: Ent_ReadArcBeam(bIsNewEntity); break;
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
                case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
diff --combined qcsrc/client/progs.src
index 5fbff743d499a619fd9fd3ec903a8df5336920a4,843ae12a47f6b4b1860744929bde122136ed898e..8ba12b9e71d957c7260fcbd09dbf80b562c9b4ee
@@@ -37,10 -37,10 +37,10 @@@ view.q
  wall.qc
  waypointsprites.qc
  
- command/commands.qc
+ command/all.qc
  
  vehicles/bumblebee.qc
- vehicles/vehicles.qc
+ vehicles/all.qc
  
  weapons/projectile.qc // TODO
  
  ../common/urllib.qc
  ../common/util.qc
  
- ../common/monsters/monsters.qc
 +../common/items/all.qc
 +
+ ../common/monsters/all.qc
  
- ../common/weapons/weapons.qc // TODO
+ ../common/weapons/all.qc // TODO
  
  ../csqcmodellib/cl_model.qc
  ../csqcmodellib/cl_player.qc
diff --combined qcsrc/menu/menu.qc
index 50183b977335f68a32d3a181479967fb48f1ad95,70f4249d038436088a5d5b05ab19aefdf23208a5..d8a3ede2e7d8988afd29865a409af7de2defe772
@@@ -2,8 -2,7 +2,8 @@@
  #include "oo/classes.qc"
  #include "xonotic/util.qh"
  
- #include "../common/weapons/weapons.qh"
 +#include "../common/items/all.qh"
+ #include "../common/weapons/all.qh"
  #include "../common/mapinfo.qh"
  
  ///////////////////////////////////////////////
@@@ -81,7 -80,6 +81,7 @@@ void m_init(
  
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
 +      CALL_ACCUMULATED_FUNCTION(RegisterItems);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
  
        RegisterSLCategories();
diff --combined qcsrc/menu/progs.src
index 124ac9db7d00ec266f4025ca714d8b4b40660e8f,636c862b7d0148f3915ca58e2f63ae1327fb89df..2315616d1701bfc29dbdbe8cc7c6ce04e8433092
@@@ -9,7 -9,7 +9,7 @@@ oo/classes.q
  draw.qc
  menu.qc
  
- command/commands.qc
+ command/all.qc
  
  xonotic/util.qc
  
  ../common/urllib.qc
  ../common/util.qc
  
- ../common/monsters/monsters.qc
 +../common/items/all.qc
 +
+ ../common/monsters/all.qc
  
- ../common/weapons/weapons.qc // TODO
+ ../common/weapons/all.qc // TODO
  
  ../warpzonelib/mathlib.qc
diff --combined qcsrc/server/g_world.qc
index 63f2db883298b7071bd86532e4684899c5e1d9b1,3806d5eb240d84ca5a2f82a4bcacc4583cb1b3f3..a31670a08a050f6997b9eb6f81e2277e3cdfe584
  #include "../common/constants.qh"
  #include "../common/deathtypes.qh"
  #include "../common/mapinfo.qh"
- #include "../common/monsters/monsters.qh"
+ #include "../common/monsters/all.qh"
  #include "../common/monsters/sv_monsters.qh"
  #include "../common/notifications.qh"
  #include "../common/playerstats.qh"
  #include "../common/stats.qh"
  #include "../common/teams.qh"
  #include "../common/util.qh"
- #include "../common/weapons/weapons.qh"
 +#include "../common/items/all.qh"
+ #include "../common/weapons/all.qh"
  
  const float LATENCY_THINKRATE = 10;
  .float latency_sum;
@@@ -189,6 -188,8 +189,8 @@@ void cvar_changes_init(
                BADCVAR("g_configversion");
                BADCVAR("g_maplist_index");
                BADCVAR("halflifebsp");
+               BADCVAR("sv_mapformat_is_quake2");
+               BADCVAR("sv_mapformat_is_quake3");
                BADPREFIX("sv_world");
  
                // client
@@@ -557,7 -558,6 +559,7 @@@ void spawnfunc___init_dedicated_server(
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
        CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
 +      CALL_ACCUMULATED_FUNCTION(RegisterItems);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
@@@ -606,7 -606,6 +608,7 @@@ void spawnfunc_worldspawn (void
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
        CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
 +      CALL_ACCUMULATED_FUNCTION(RegisterItems);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
index 5f663ccdcaed9b321fd251957450a041dce5e847,079df60f81fc501b03b411f4eb196006427f53ac..e8a1529e4e872209c96abef938ebde04875449fc
@@@ -21,7 -21,7 +21,7 @@@
  #include "../common/teams.qh"
  #include "../common/urllib.qh"
  #include "../common/util.qh"
- #include "../common/weapons/weapons.qh"
+ #include "../common/weapons/all.qh"
  #include "../csqcmodellib/sv_model.qh"
  #include "../warpzonelib/anglestransform.qh"
  #include "../warpzonelib/server.qh"
@@@ -1270,7 -1270,7 +1270,7 @@@ void SetCustomizer(entity e, float(void
  }
  
  
 -void Net_LinkEntity(entity e, float docull, float dt, bool(entity, int) sendfunc)
 +void Net_LinkEntity(entity e, bool docull, float dt, bool(entity, int) sendfunc)
  {
      vector mi, ma;
  
diff --combined qcsrc/server/progs.src
index 0455f6b6bfb49a93852bc3b2a3785062343795e4,a812de46a4c612e7f96641b6690ee92881c6ac49..75301d592972ee3e67ade8b01a84a72c7d188f19
@@@ -67,7 -67,7 +67,7 @@@ bot/havocbot/role_keyhunt.q
  bot/havocbot/role_onslaught.qc
  bot/havocbot/roles.qc
  
- command/commands.qc
+ command/all.qc
  
  mutators/mutators_include.qc
  mutators/mutators.qc
@@@ -97,7 -97,7 +97,7 @@@ weapons/weaponsystem.q
  ../common/campaign_file.qc
  ../common/campaign_setup.qc
  ../common/mapinfo.qc
- ../common/monsters/monsters.qc
+ ../common/monsters/all.qc
  ../common/monsters/spawn.qc
  ../common/monsters/sv_monsters.qc
  ../common/nades.qc
  ../common/test.qc
  ../common/urllib.qc
  ../common/util.qc
 +
 +../common/items/all.qc
 +
  ../common/weapons/config.qc
- ../common/weapons/weapons.qc // TODO
+ ../common/weapons/all.qc // TODO
  
  ../csqcmodellib/sv_model.qc
  
diff --combined qcsrc/server/t_items.qc
index 009f7c26340e92a3456bd6a568ce437e220d492c,515677bfa74decd23c7852262c92c979e1f1acb6..f817957c8213d62df0ea1dd856bb446760708728
@@@ -1,7 -1,5 +1,7 @@@
  #include "t_items.qh"
  
 +#include "../common/items/all.qc"
 +
  #if defined(SVQC)
      #include "_all.qh"
  
@@@ -22,9 -20,9 +22,9 @@@
      #include "../common/notifications.qh"
      #include "../common/util.qh"
  
-     #include "../common/monsters/monsters.qh"
+     #include "../common/monsters/all.qh"
  
-     #include "../common/weapons/weapons.qh"
+     #include "../common/weapons/all.qh"
  
      #include "../warpzonelib/util_server.qh"
  #endif
@@@ -665,8 -663,6 +665,8 @@@ float Item_GiveTo(entity item, entity p
        return 1;
  }
  
 +.entity itemdef;
 +
  void Item_Touch (void)
  {
        entity e, head;
                self.invincible_finished = max(0, self.invincible_finished - time);
                self.superweapons_finished = max(0, self.superweapons_finished - time);
        }
 -
 -      if(!Item_GiveTo(self, other))
 +      entity it = self.itemdef;
 +      bool gave = (it && it.instanceOfPickup) ? ITEM_HANDLE(Pickup, it, self, other) : Item_GiveTo(self, other);
 +      if (!gave)
        {
                if (self.classname == "droppedweapon")
                {
  
        if (self.classname == "droppedweapon")
                remove (self);
 -      else if (!self.spawnshieldtime)
 -              return;
 -      else
 +      else if (self.spawnshieldtime)
        {
                if(self.team)
                {
@@@ -1154,19 -1151,12 +1154,19 @@@ void StartItem (string itemmodel, strin
                return;
        }
  }
 +
 +void StartItemA (entity a)
 +{
 +    self.itemdef = a;
 +    StartItem(a.m_model, a.m_sound, a.m_respawntime(), a.m_respawntimejitter(), a.m_name, a.m_itemid, 0, a.m_itemflags, a.m_pickupevalfunc, a.m_botvalue);
 +}
 +
  void spawnfunc_item_rockets (void) {
        if(!self.ammo_rockets)
                self.ammo_rockets = g_pickup_rockets;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_ammo_anyway;
 -      StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "rockets", IT_ROCKETS, 0, 0, commodity_pickupevalfunc, 3000);
 +    StartItemA (ITEM_Rockets);
  }
  
  void spawnfunc_item_bullets (void) {
                self.ammo_nails = g_pickup_nails;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_ammo_anyway;
 -      StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "bullets", IT_NAILS, 0, 0, commodity_pickupevalfunc, 2000);
 +    StartItemA (ITEM_Bullets);
  }
  
  void spawnfunc_item_cells (void) {
                self.ammo_cells = g_pickup_cells;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_ammo_anyway;
 -      StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "cells", IT_CELLS, 0, 0, commodity_pickupevalfunc, 2000);
 +      StartItemA (ITEM_Cells);
  }
  
  void spawnfunc_item_plasma()
                self.ammo_plasma = g_pickup_plasma;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_ammo_anyway;
 -      StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "plasma", IT_PLASMA, 0, 0, commodity_pickupevalfunc, 2000);
 +      StartItemA (ITEM_Plasma);
  }
  
  void spawnfunc_item_shells (void) {
                self.ammo_shells = g_pickup_shells;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_ammo_anyway;
 -      StartItem ("models/items/a_shells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "shells", IT_SHELLS, 0, 0, commodity_pickupevalfunc, 500);
 +      StartItemA (ITEM_Shells);
  }
  
  void spawnfunc_item_armor_small (void) {
                self.max_armorvalue = g_pickup_armorsmall_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorsmall_anyway;
 -      StartItem ("models/items/item_armor_small.md3", "misc/armor1.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 +      StartItemA (ITEM_ArmorSmall);
  }
  
  void spawnfunc_item_armor_medium (void) {
                self.max_armorvalue = g_pickup_armormedium_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armormedium_anyway;
 -      StartItem ("models/items/item_armor_medium.md3", "misc/armor10.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
 +      StartItemA (ITEM_ArmorMedium);
  }
  
  void spawnfunc_item_armor_big (void) {
                self.max_armorvalue = g_pickup_armorbig_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorbig_anyway;
 -      StartItem ("models/items/item_armor_big.md3", "misc/armor17_5.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "50 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000);
 +      StartItemA (ITEM_ArmorBig);
  }
  
  void spawnfunc_item_armor_large (void) {
                self.max_armorvalue = g_pickup_armorlarge_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorlarge_anyway;
 -      StartItem ("models/items/item_armor_large.md3", "misc/armor25.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
 +      StartItemA (ITEM_ArmorLarge);
  }
  
  void spawnfunc_item_health_small (void) {
                self.health = g_pickup_healthsmall;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_healthsmall_anyway;
 -      StartItem ("models/items/g_h1.md3", "misc/minihealth.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Health", IT_5HP, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 +      StartItemA (ITEM_HealthSmall);
  }
  
  void spawnfunc_item_health_medium (void) {
                self.health = g_pickup_healthmedium;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_healthmedium_anyway;
 -      StartItem ("models/items/g_h25.md3", "misc/mediumhealth.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "25 Health", IT_25HP, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
 +    StartItemA (ITEM_HealthMedium);
  }
  
  void spawnfunc_item_health_large (void) {
                self.health = g_pickup_healthlarge;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_healthlarge_anyway;
 -      StartItem ("models/items/g_h50.md3", "misc/mediumhealth.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "50 Health", IT_25HP, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
 +      StartItemA (ITEM_HealthLarge);
  }
  
  void spawnfunc_item_health_mega (void) {
 -              if(!self.max_health)
 -                      self.max_health = g_pickup_healthmega_max;
 -              if(!self.health)
 -                      self.health = g_pickup_healthmega;
 -              if(!self.pickup_anyway)
 -                      self.pickup_anyway = g_pickup_healthmega_anyway;
 -              StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Health", IT_HEALTH, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
 +    if(!self.max_health)
 +        self.max_health = g_pickup_healthmega_max;
 +    if(!self.health)
 +        self.health = g_pickup_healthmega;
 +    if(!self.pickup_anyway)
 +        self.pickup_anyway = g_pickup_healthmega_anyway;
 +    StartItemA (ITEM_HealthMega);
  }
  
  // support old misnamed entities
@@@ -1313,13 -1303,13 +1313,13 @@@ void spawnfunc_item_strength (void) 
                precache_sound("weapons/strength_fire.wav");
                if(!self.strength_finished)
                        self.strength_finished = autocvar_g_balance_powerup_strength_time;
 -              StartItem ("models/items/g_strength.md3", "misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Strength Powerup", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
 +              StartItemA (ITEM_Strength);
  }
  
  void spawnfunc_item_invincible (void) {
                if(!self.invincible_finished)
                        self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
 -              StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Shield", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
 +              StartItemA (ITEM_Shield);
  }
  
  // compatibility:
@@@ -1480,7 -1470,7 +1480,7 @@@ void spawnfunc_item_fuel(void
                self.ammo_fuel = g_pickup_fuel;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_ammo_anyway;
 -      StartItem ("models/items/g_fuel.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "Fuel", IT_FUEL, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 +      StartItemA (ITEM_JetpackFuel);
  }
  
  void spawnfunc_item_fuel_regen(void)
                spawnfunc_item_fuel();
                return;
        }
 -      StartItem ("models/items/g_fuelregen.md3", "misc/itempickup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Fuel regenerator", IT_FUEL_REGEN, 0, FL_POWERUP, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 +      StartItemA (ITEM_JetpackRegen);
  }
  
  void spawnfunc_item_jetpack(void)
                spawnfunc_item_fuel();
                return;
        }
 -      StartItem ("models/items/g_jetpack.md3", "misc/itempickup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Jet pack", IT_JETPACK, 0, FL_POWERUP, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 +      StartItemA (ITEM_Jetpack);
  }
  
  float GiveWeapon(entity e, float wpn, float op, float val)