From: bones_was_here Date: Sun, 18 Oct 2020 11:18:12 +0000 (+1000) Subject: Merge branch 'master' into bones_was_here/q3compat X-Git-Tag: xonotic-v0.8.5~352^2~16 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=d24e46b65c1fe73fae4cf8034f4e7f318a17053a Merge branch 'master' into bones_was_here/q3compat --- d24e46b65c1fe73fae4cf8034f4e7f318a17053a diff --cc qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 88fd6aa73,50b5d91b5..dbe43ace3 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@@ -57,9 -56,16 +56,16 @@@ void buffs_BuffModel_Spawn(entity playe setcefc(player.buff_model, buffs_BuffModel_Customize); } + void buffs_BuffModel_Remove(entity player) + { + if(player.buff_model) + delete(player.buff_model); + player.buff_model = NULL; + } + vector buff_GlowColor(entity buff) { - //if(buff.team) { return Team_ColorRGB(buff.team); } + //if(buff.team_forced) { return Team_ColorRGB(buff.team_forced); } return buff.m_color; } diff --cc qcsrc/lib/spawnfunc.qh index 939c5a7e5,5c1cfac37..54732766b --- a/qcsrc/lib/spawnfunc.qh +++ b/qcsrc/lib/spawnfunc.qh @@@ -283,13 -277,9 +283,14 @@@ noref bool __spawnfunc_first if (!this.sourceLoc) { \ this.sourceLoc = __FILE__":"STR(__LINE__); \ } \ + this.classname = #id; \ if (!this.spawnfunc_checked) { \ _checkWhitelisted(this, #id); \ + if (__fullspawndata) { \ + /* not supported in old DP */ \ + /* must be read inside the real spawnfunc */ \ + this.fullspawndata = __fullspawndata; \ + } \ this.spawnfunc_checked = true; \ if (this) { \ /* not worldspawn, delay spawn */ \ diff --cc qcsrc/server/compat/quake.qc index 8c227f9be,a49b85f18..279b3155d --- a/qcsrc/server/compat/quake.qc +++ b/qcsrc/server/compat/quake.qc @@@ -1,16 -1,13 +1,16 @@@ #include "quake.qh" - #include #include #include + #include -//*********************** -//QUAKE 1 ENTITIES - So people can play quake1 maps with the xonotic weapons -//*********************** -SPAWNFUNC_WEAPON(weapon_nailgun, WEP_ELECTRO) +/*********************** + * QUAKE 1 ENTITIES - So people can play quake1 maps with the xonotic weapons + *********************** + weapon_nailgun handled in quake3.qc + item_armor1 handled in items.qc +*/ + SPAWNFUNC_WEAPON(weapon_supernailgun, WEP_HAGAR) SPAWNFUNC_WEAPON(weapon_supershotgun, WEP_MACHINEGUN) diff --cc qcsrc/server/compat/quake3.qc index 4c50ea51f,ea951ddce..5acd24a58 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@@ -1,84 -1,54 +1,85 @@@ #include "quake3.qh" - #include - #include - #include - #include - #include - #include - #include #include #include - #include #include + #include #include #include + #include + #include + #include + #include + #include + #include + #include + #include -//*********************** -//QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons -//*********************** +/*********************** + * QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons + *********************** + + * Map entities NOT handled in this file: + holdable_invulnerability Q3TA buffs mutator + holdable_kamikaze Q3TA buffs mutator + holdable_teleporter Q3A buffs mutator + item_ammoregen Q3TA buffs mutator + item_doubler Q3TA buffs mutator + item_guard Q3TA buffs mutator + item_scout Q3TA buffs mutator + item_armor_jacket CPMA quake2.qc + item_flight Q3A buffs mutator + item_haste Q3A buffs mutator + item_health Q3A quake.qc + item_health_large Q3A items.qc + item_health_small Q3A health.qh + item_health_mega Q3A health.qh + item_invis Q3A buffs mutator + item_quad Q3A items.qc + item_regen Q3A buffs mutator + weapon_machinegun Q3A machinegun.qh + weapon_grenadelauncher Q3A mortar.qh + weapon_rocketlauncher Q3A devastator.qh + CTF spawnfuncs handled in sv_ctf.qc + + NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG +*/ + +// SG -> MG || SG +SPAWNFUNC_Q3_COND(weapon_shotgun, ammo_shells, (q3compat & Q3COMPAT_ARENA), WEP_MACHINEGUN, WEP_SHOTGUN) + +// MG -> SG || MG +// Technically we should replace weapon_machinegun with WEP_SHOTGUN if Q3COMPAT_ARENA, but it almost never occurs on Q3 maps +SPAWNFUNC_Q3AMMO_COND(ammo_bullets, (q3compat & Q3COMPAT_ARENA), WEP_SHOTGUN, WEP_MACHINEGUN) -// NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG +// GL -> Mortar +SPAWNFUNC_Q3AMMO(ammo_grenades, WEP_MORTAR) -// SG -> SG -SPAWNFUNC_ITEM(ammo_shells, ITEM_Shells) +// Team Arena Proximity Launcher -> Mortar +// It's more accurate to spawn Mine Layer but players prefer Mortar, and weapon_grenadelauncher is usually disabled by "notta" and weapon_prox_launcher placed at the same origin +SPAWNFUNC_Q3(weapon_prox_launcher, ammo_mines, WEP_MORTAR) -// MG -> MG -SPAWNFUNC_ITEM(ammo_bullets, ITEM_Bullets) +// Team Arena Chaingun -> HLAC +SPAWNFUNC_Q3(weapon_chaingun, ammo_belt, WEP_HLAC) -// GL -> Mortar -SPAWNFUNC_ITEM(ammo_grenades, ITEM_Rockets) +// Quake Live Heavy Machine Gun -> HLAC +SPAWNFUNC_Q3(weapon_hmg, ammo_hmg, WEP_HLAC) -// Mines -> Rockets -SPAWNFUNC_WEAPON(weapon_prox_launcher, WEP_MINE_LAYER) -SPAWNFUNC_ITEM(ammo_mines, ITEM_Rockets) +// Team Arena Nailgun -> Crylink || Quake Nailgun -> Electro +SPAWNFUNC_Q3_COND(weapon_nailgun, ammo_nails, cvar("sv_mapformat_is_quake3"), WEP_CRYLINK, WEP_ELECTRO) -// LG -> Lightning -SPAWNFUNC_WEAPON(weapon_lightning, WEP_ELECTRO) -SPAWNFUNC_ITEM(ammo_lightning, ITEM_Cells) +// LG -> Electro +SPAWNFUNC_Q3(weapon_lightning, ammo_lightning, WEP_ELECTRO) // Plasma -> Hagar -SPAWNFUNC_WEAPON(weapon_plasmagun, WEP_HAGAR) -SPAWNFUNC_ITEM(ammo_cells, ITEM_Rockets) +SPAWNFUNC_Q3(weapon_plasmagun, ammo_cells, WEP_HAGAR) // Rail -> Vortex -SPAWNFUNC_WEAPON(weapon_railgun, WEP_VORTEX) -SPAWNFUNC_ITEM(ammo_slugs, ITEM_Cells) +SPAWNFUNC_Q3(weapon_railgun, ammo_slugs, WEP_VORTEX) -// BFG -> Crylink -SPAWNFUNC_WEAPON(weapon_bfg, WEP_CRYLINK) -SPAWNFUNC_ITEM(ammo_bfg, ITEM_Cells) +// BFG -> Crylink || Fireball +SPAWNFUNC_Q3_COND(weapon_bfg, ammo_bfg, cvar_string("g_mod_balance") == "XDF", WEP_CRYLINK, WEP_FIREBALL) + // FIXME: WEP_FIREBALL has no ammo_type field so ammo_bfg is deleted by SPAWNFUNC_BODY // grappling hook -> hook SPAWNFUNC_WEAPON(weapon_grapplinghook, WEP_HOOK)