X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcompat%2Fquake3.qc;h=911ab0f815534dfcebd5e10c35ab7ed658be0d72;hb=ba8ae4694fcaae610fc923f0f13a3b9238a53999;hp=5acd24a58aea87f4e1d660e0ff9cfa73c34e3d59;hpb=d24e46b65c1fe73fae4cf8034f4e7f318a17053a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index 5acd24a58..911ab0f81 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -5,14 +5,17 @@ #include #include #include +#include +#include +#include #include +#include #include #include #include #include #include #include -#include #include /*********************** @@ -20,27 +23,24 @@ *********************** * 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 + holdable_invulnerability Q3TA buffs/all.inc + holdable_kamikaze Q3TA buffs/all.inc + holdable_teleporter Q3A buffs/all.inc + item_ammoregen Q3TA buffs/all.inc + item_doubler Q3TA buffs/all.inc + item_guard Q3TA buffs/all.inc + item_scout Q3TA buffs/all.inc + item_armor_jacket CPMA quake2.qc + item_flight Q3A buffs/all.inc + item_health Q3A quake.qc + item_health_large Q3A items/spawning.qc + item_health_small Q3A health.qh + item_health_mega Q3A health.qh + item_regen Q3A buffs/all.inc + weapon_machinegun Q3A machinegun.qh + weapon_grenadelauncher Q3A mortar.qh + weapon_rocketlauncher Q3A devastator.qh + * CTF spawnfuncs 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 */ @@ -96,8 +96,11 @@ SPAWNFUNC_ITEM(item_armor_combat, ITEM_ArmorBig) SPAWNFUNC_ITEM(item_armor_shard, ITEM_ArmorSmall) SPAWNFUNC_ITEM(item_armor_green, ITEM_ArmorMedium) // CCTF -// Battle Suit +// Powerups +SPAWNFUNC_ITEM(item_quad, ITEM_Strength) SPAWNFUNC_ITEM(item_enviro, ITEM_Shield) +SPAWNFUNC_ITEM(item_haste, ITEM_Speed) +SPAWNFUNC_ITEM(item_invis, ITEM_Invisibility) // medkit -> armor (we have no holdables) SPAWNFUNC_ITEM(holdable_medkit, ITEM_ArmorBig) @@ -167,17 +170,19 @@ void target_init_use(entity this, entity actor, entity trigger) if (!(this.spawnflags & 8)) { - STAT(STRENGTH_FINISHED, actor) = 0; - STAT(INVINCIBLE_FINISHED, actor) = 0; - if(STAT(BUFFS, actor)) // TODO: make a dropbuffs function to handle this + FOREACH(StatusEffect, it.instanceOfPowerups, { - int buffid = buff_FirstFromFlags(STAT(BUFFS, actor)).m_id; + it.m_remove(it, actor, STATUSEFFECT_REMOVE_NORMAL); + }); + entity heldbuff = buff_FirstFromFlags(actor); + if(heldbuff) // TODO: make a dropbuffs function to handle this + { + int buffid = heldbuff.m_id; Send_Notification(NOTIF_ONE, actor, MSG_MULTI, ITEM_BUFF_DROP, buffid); sound(actor, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM); if(!IS_INDEPENDENT_PLAYER(actor)) Send_Notification(NOTIF_ALL_EXCEPT, actor, MSG_INFO, INFO_ITEM_BUFF_LOST, actor.netname, buffid); - STAT(BUFFS, actor) = 0; - STAT(BUFF_TIME, actor) = 0; + buff_RemoveAll(actor, STATUSEFFECT_REMOVE_NORMAL); } } @@ -202,30 +207,23 @@ void target_give_init(entity this) { if (it.classname == "item_buff") { - entity buff = buff_FirstFromFlags(STAT(BUFFS, it)); - this.netname = cons(this.netname, buff.netname); - STAT(BUFF_TIME, this) += it.count; + this.netname = cons(this.netname, it.buffdef.netname); + this.buffs_finished += it.buffs_finished; } else { - if (it.ammo_rockets) - this.ammo_rockets += it.ammo_rockets; - else if (it.ammo_cells) - this.ammo_cells += it.ammo_cells; - else if (it.ammo_shells) - this.ammo_shells += it.ammo_shells; - else if (it.ammo_nails) - this.ammo_nails += it.ammo_nails; - else if (it.invincible_finished) - this.invincible_finished += it.invincible_finished; - else if (it.strength_finished) - this.strength_finished += it.strength_finished; - else if (it.health) - this.health += it.health; - else if (it.armorvalue) - this.armorvalue += it.armorvalue; - - this.netname = cons(this.netname, it.netname); + this.ammo_rockets += it.ammo_rockets; + this.ammo_cells += it.ammo_cells; + this.ammo_shells += it.ammo_shells; + this.ammo_nails += it.ammo_nails; + this.invincible_finished += it.invincible_finished; + this.strength_finished += it.strength_finished; + this.speed_finished += it.speed_finished; + this.invisibility_finished += it.invisibility_finished; + this.health += it.health; + this.armorvalue += it.armorvalue; + + this.netname = cons(this.netname, (it.itemdef.m_weapon) ? it.itemdef.m_weapon.netname : it.itemdef.netname); } //remove(it); // removing ents in init functions causes havoc, workaround: @@ -300,6 +298,7 @@ bool DoesQ3ARemoveThisEntity(entity this) if(this.notta) return true; + // FIXME: singleplayer does not use maxclients 1 as that would prevent bots if(this.notsingle) if(maxclients == 1) return true;