X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ft_quake3.qc;h=bb1128bd60e8c532c217de9d8f9d99f9c0404d27;hb=daaa53f974bdb4cdf8ec00714eae77d2bdd5e128;hp=cffe88bd7fff5acfe21bc2ca98f26af4ffe99bcf;hpb=cb78214cf1252fa80df3490c0cd3d41bae72bbb8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/t_quake3.qc b/qcsrc/server/t_quake3.qc index cffe88bd7..bb1128bd6 100644 --- a/qcsrc/server/t_quake3.qc +++ b/qcsrc/server/t_quake3.qc @@ -22,9 +22,9 @@ void spawnfunc_ammo_lightning() { spawnfunc_item_cells(); } void spawnfunc_weapon_plasmagun() { spawnfunc_weapon_hagar(); } void spawnfunc_ammo_cells() { spawnfunc_item_rockets(); } -// Rail -> Rifle -void spawnfunc_weapon_railgun() { spawnfunc_weapon_campingrifle(); } -void spawnfunc_ammo_slugs() { spawnfunc_item_bullets(); } +// Rail -> Nex +void spawnfunc_weapon_railgun() { spawnfunc_weapon_nex(); } +void spawnfunc_ammo_slugs() { spawnfunc_item_cells(); } // BFG -> Crylink void spawnfunc_weapon_bfg() { spawnfunc_weapon_crylink(); } @@ -39,12 +39,31 @@ void spawnfunc_item_armor_combat() { spawnfunc_item_armor_big(); } void spawnfunc_item_armor_shard() { spawnfunc_item_armor_small(); } void spawnfunc_item_enviro() { spawnfunc_item_invincible(); } -// weapon remove ent from defrag +// weapon remove ent from df +void target_init_verify() +{ + entity trigger, targ; + for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); ) + for(targ = world; (targ = find(targ, targetname, trigger.target)); ) + if (targ.classname == "target_init" || targ.classname == "target_give" || targ.classname == "target_items") + { + trigger.wait = 0; + trigger.delay = 0; + targ.wait = 0; + targ.delay = 0; + + //setsize(targ, trigger.mins, trigger.maxs); + //setorigin(targ, trigger.origin); + //remove(trigger); + } +} + void spawnfunc_target_init() { self.spawnflags = 0; // remove all weapons except the ones listed below - self.netname = "laser uzi"; // keep these weapons through the remove trigger + self.netname = "shotgun"; // keep these weapons through the remove trigger spawnfunc_target_items(); + InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET); } // weapon give ent from defrag @@ -53,25 +72,25 @@ void target_give_init() entity targ; for (targ = world; (targ = find(targ, targetname, self.target)); ) { if (targ.classname == "weapon_rocketlauncher") { - self.ammo_rockets += targ.count * cvar("g_balance_rocketlauncher_ammo"); + self.ammo_rockets += targ.count * autocvar_g_balance_rocketlauncher_ammo; self.netname = "rocketlauncher"; } else if (targ.classname == "weapon_plasmagun") { - self.ammo_rockets += targ.count * cvar("g_balance_hagar_primary_ammo"); + self.ammo_rockets += targ.count * autocvar_g_balance_hagar_primary_ammo; if(self.netname == "") self.netname = "hagar"; else self.netname = strcat(self.netname, " hagar"); } else if (targ.classname == "weapon_bfg") { - self.ammo_cells += targ.count * cvar("g_balance_crylink_primary_ammo"); + self.ammo_cells += targ.count * autocvar_g_balance_crylink_primary_ammo; if(self.netname == "") self.netname = "crylink"; else self.netname = strcat(self.netname, " crylink"); } else if (targ.classname == "weapon_grenadelauncher") { - self.ammo_rockets += targ.count * cvar("g_balance_grenadelauncher_primary_ammo"); + self.ammo_rockets += targ.count * autocvar_g_balance_grenadelauncher_primary_ammo; if(self.netname == "") self.netname = "grenadelauncher"; else @@ -81,10 +100,13 @@ void target_give_init() self.armorvalue = 100; else if (targ.classname == "item_health_mega") self.health = 200; - remove(targ); + //remove(targ); // removing ents in init functions causes havoc, workaround: + targ.think = SUB_Remove; + targ.nextthink = time; } self.spawnflags = 2; spawnfunc_target_items(); + InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET); } void spawnfunc_target_give() @@ -100,11 +122,56 @@ void spawnfunc_target_give() //void spawnfunc_item_health_mega() /* handled in t_items.qc */ //void spawnfunc_item_invis() /* not supported */ //void spawnfunc_item_regen() /* not supported */ -void spawnfunc_team_CTF_redflag() { spawnfunc_item_flag_team1(); } -void spawnfunc_team_CTF_blueflag() { spawnfunc_item_flag_team2(); } -void spawnfunc_team_CTF_redplayer() { spawnfunc_info_player_team1(); } -void spawnfunc_team_CTF_blueplayer() { spawnfunc_info_player_team2(); } -void spawnfunc_team_CTF_redspawn() { spawnfunc_info_player_team1(); } -void spawnfunc_team_CTF_bluespawn() { spawnfunc_info_player_team2(); } + +// CTF spawnfuncs handled in mutators/gamemode_ctf.qc now void spawnfunc_item_flight() { spawnfunc_item_jetpack(); } + +.float notteam; +.float notsingle; +.float notfree; +.float notq3a; +.float notta; +.string gametype; +float DoesQ3ARemoveThisEntity() +{ + // Q3 style filters (DO NOT USE, THIS IS COMPAT ONLY) + + if(self.notq3a) + if(!teamplay || g_tdm || g_ctf) + return 1; + + if(self.notta) + if (!(!teamplay || g_tdm || g_ctf)) + return 1; + + if(self.notsingle) + if(maxclients == 1) + return 1; + + if(self.notteam) + if(teamplay) + return 1; + + if(self.notfree) + if(!teamplay) + return 1; + + if(self.gametype) + { + string gametypename; + // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"} + gametypename = "ffa"; + if(teamplay) + gametypename = "team"; + if(g_ctf) + gametypename = "ctf"; + if(maxclients == 1) + gametypename = "single"; + // we do not have the other types (oneflag, obelisk, harvester, teamtournament) + if(strstrofs(self.gametype, gametypename, 0) < 0) + return 1; + } + + return 0; +}