X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ft_items.qc;h=ec39afcc8c9ccd5c89ead9c8363def8fbea16dc7;hb=42b501c5da481b2598db9bfc1b93b06fede3657a;hp=5a86bee8391a617e719bc3d3e419b2eed2780b9a;hpb=f209ef256e1c8cc09fcfb1cf3b3f30f34345e88b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 5a86bee83..ec39afcc8 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -96,7 +96,7 @@ void Item_Show (entity e, float mode) } else if((e.flags & FL_WEAPON) && (g_weapon_stay == 3)) { - // make the item translucent green and not touchable + // make the item translucent and not touchable e.model = e.mdl; e.solid = SOLID_TRIGGER; // can STILL be picked up! e.colormod = '0 0 0'; @@ -108,7 +108,7 @@ void Item_Show (entity e, float mode) } else if(g_ghost_items) { - // make the item translucent green and not touchable + // make the item translucent and not touchable e.model = e.mdl; e.solid = SOLID_NOT; e.colormod = stov(autocvar_g_ghost_items_color); @@ -123,7 +123,7 @@ void Item_Show (entity e, float mode) // hide the item completely e.model = string_null; e.solid = SOLID_NOT; - e.colormod = stov(autocvar_g_ghost_items_color); + e.colormod = '0 0 0'; e.glowmod = e.colormod; e.alpha = 0; e.customizeentityforclient = func_null; @@ -146,11 +146,11 @@ void Item_Respawn (void) { Item_Show(self, 1); if(!g_minstagib && self.items == IT_STRENGTH) - sound (self, CHAN_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound + sound (self, CH_TRIGGER_SINGLE, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound else if(!g_minstagib && self.items == IT_INVINCIBLE) - sound (self, CHAN_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound + sound (self, CH_TRIGGER_SINGLE, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound else - sound (self, CHAN_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound + sound (self, CH_TRIGGER_SINGLE, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound setorigin (self, self.origin); //pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1); @@ -198,16 +198,12 @@ void Item_RespawnCountdown (void) } if(name) { - WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE); + WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb); if(self.waypointsprite_attached) - { - WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, rgb); - //WaypointSprite_UpdateMaxHealth(self.waypointsprite_attached, ITEM_RESPAWN_TICKS + 1); WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS); - } } } - sound (self, CHAN_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound + sound (self, CH_TRIGGER_SINGLE, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound if(self.waypointsprite_attached) { WaypointSprite_Ping(self.waypointsprite_attached); @@ -283,7 +279,6 @@ float Item_GiveTo(entity item, entity player) { pickedup = TRUE; // play some cool sounds ;) - centerprint(player, "\n"); if (clienttype(player) == CLIENTTYPE_REAL) { if(player.health <= 5) @@ -395,7 +390,7 @@ float Item_GiveTo(entity item, entity player) } if (item.flags & FL_WEAPON) - if ((it = item.weapons - (item.weapons & player.weapons)) || g_pickup_weapons_anyway) + if ((it = item.weapons - (item.weapons & player.weapons)) || (g_pickup_weapons_anyway && !(g_weapon_stay == 3 && !e.spawnshieldtime))) { pickedup = TRUE; for(i = WEP_FIRST; i <= WEP_LAST; ++i) @@ -451,7 +446,7 @@ float Item_GiveTo(entity item, entity player) if (!pickedup) return 0; - sound (player, CHAN_AUTO, item.item_pickupsound, VOL_BASE, ATTN_NORM); + sound (player, CH_TRIGGER, item.item_pickupsound, VOL_BASE, ATTN_NORM); if (_switchweapon) if (player.switchweapon != w_getbestweapon(player)) W_SwitchWeapon_Force(player, w_getbestweapon(player)); @@ -590,7 +585,7 @@ float weapon_pickupevalfunc(entity player, entity item) // If custom weapon priorities for bots is enabled rate most wanted weapons higher if( bot_custom_weapon && c ) { - for(i = WEP_FIRST; i < WEP_LAST ; ++i) + for(i = WEP_FIRST; i <= WEP_LAST ; ++i) { // Find weapon if( (get_weaponinfo(i)).weapons & item.weapons != item.weapons ) @@ -630,7 +625,7 @@ float commodity_pickupevalfunc(entity player, entity item) c = 0; // Detect needed ammo - for(i = WEP_FIRST; i < WEP_LAST ; ++i) + for(i = WEP_FIRST; i <= WEP_LAST ; ++i) { wi = get_weaponinfo(i); @@ -735,36 +730,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, waypoint_spawnforitem(self); } - if(teams_matter) - { - if(self.notteam) - { - print("removed non-teamplay ", self.classname, "\n"); - startitem_failed = TRUE; - remove (self); - return; - } - } - else - { - if(self.notfree) - { - print("removed non-FFA ", self.classname, "\n"); - startitem_failed = TRUE; - remove (self); - return; - } - } - - if(self.notq3a) - { - // We aren't TA or something like that, so we keep the Q3A entities - print("removed non-Q3A ", self.classname, "\n"); - startitem_failed = TRUE; - remove (self); - return; - } - /* * can't do it that way, as it would break maps * TODO make a target_give like entity another way, that perhaps has @@ -1566,12 +1531,12 @@ void GiveSound(entity e, float v0, float v1, float t, string snd_incr, string sn if(v1 <= v0 - t) { if(snd_decr != "") - sound (e, CHAN_AUTO, snd_decr, VOL_BASE, ATTN_NORM); + sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTN_NORM); } else if(v0 >= v0 + t) { if(snd_incr != "") - sound (e, CHAN_AUTO, snd_incr, VOL_BASE, ATTN_NORM); + sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTN_NORM); } }