X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_client.qc;h=f699e6db2f3e1733ebb87e708d60c6fc84b91919;hb=6c6d85a09727ef5e6ca7ac0abc54b11895aa59d1;hp=a69de5b1bc16ef80421cd6d55f7d3b01488eef3f;hpb=8bac780bb3585a2668469ea787ca92474bb89ed5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index a69de5b1b..f699e6db2 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -328,13 +328,28 @@ entity SelectSpawnPoint (float anypoint) if(anypoint) teamcheck = -1; else if(have_team_spawns > 0) - teamcheck = self.team; // MUST be team - else if(have_team_spawns == 0 && have_noteam_spawns) + { + if(have_team_spawns_forteam[self.team] == 0) + { + // we request a spawn for a team, and we have team + // spawns, but that team has no spawns? + if(have_team_spawns_forteam[0]) + // try noteam spawns + teamcheck = 0; + else + // if not, any spawn has to do + teamcheck = -1; + } + else + teamcheck = self.team; // MUST be team + } + else if(have_team_spawns == 0 && have_team_spawns_forteam[0]) teamcheck = 0; // MUST be noteam else teamcheck = -1; // if we get here, we either require team spawns but have none, or we require non-team spawns and have none; use any spawn then + // get the list of players playerlist = findchain(classname, "player"); // get the entire list of spots @@ -1064,6 +1079,7 @@ void PutClientInServer (void) if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo")); } + self.weapon_forbidchange = FALSE; oldself = self; self = spot; @@ -1121,6 +1137,7 @@ float ClientInit_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_secondary); // client has to know if it should zoom or not WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not WriteByte(MSG_ENTITY, autocvar_g_balance_minelayer_limit); // minelayer max mines + WriteByte(MSG_ENTITY, autocvar_g_balance_hagar_secondary_load_max); // hagar max loadable rockets WriteCoord(MSG_ENTITY, autocvar_g_trueaim_minrange); return TRUE; } @@ -1508,7 +1525,7 @@ Called when a client connects to the server string ColoredTeamName(float t); void DecodeLevelParms (void); //void dom_player_join_team(entity pl); -void set_dom_state(void); +void set_dom_state(entity e); void ClientConnect (void) { float t; @@ -1525,7 +1542,7 @@ void ClientConnect (void) DecodeLevelParms(); #ifdef WATERMARK - sprint(self, strcat("^4SVQC Build information: ", WATERMARK(), "\n")); + sprint(self, strcat("^4SVQC Build information: ^1", WATERMARK(), "\n")); #endif self.classname = "player_joining"; @@ -1751,18 +1768,11 @@ void ClientConnect (void) send_CSQC_teamnagger(); if (g_domination) - set_dom_state(); + set_dom_state(self); CheatInitClient(); PlayerStats_AddPlayer(self); - - self.shownames = spawn(); - self.shownames.owner = self; - self.shownames.think = shownames_think; - self.shownames.nextthink = time; - self.shownames.customizeentityforclient = shownames_customize; - Net_LinkEntity(self.shownames, FALSE, 0, SendEntity_ShowNames); } /* @@ -1773,7 +1783,6 @@ Called when a client disconnects from the server ============= */ .entity chatbubbleentity; -.entity teambubbleentity; void ReadyCount(); void ClientDisconnect (void) { @@ -1827,9 +1836,6 @@ void ClientDisconnect (void) if (self.chatbubbleentity) remove (self.chatbubbleentity); - if (self.teambubbleentity) - remove (self.teambubbleentity); - if (self.killindicator) remove (self.killindicator); @@ -1862,8 +1868,6 @@ void ClientDisconnect (void) self.playerid = 0; ReadyCount(); - remove(self.shownames); - // free cvars GetCvars(-1); } @@ -1912,52 +1916,6 @@ void UpdateChatBubble() } -void TeamBubbleThink() -{ - self.nextthink = time; - if (!self.owner.modelindex || self.owner.teambubbleentity != self) - { - if(self.owner) // but why can that ever be world? - self.owner.teambubbleentity = world; - remove(self); - return; - } -// setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1'); // bandwidth hog. setattachment does this now - if (self.owner.BUTTON_CHAT || self.owner.deadflag || self.owner.killindicator) - self.model = ""; - else - self.model = self.mdl; - -}; - -float TeamBubble_customizeentityforclient() -{ - return (self.owner != other && self.owner.team == other.team && other.killcount > -666); -} - -void UpdateTeamBubble() -{ - if (!self.modelindex || !teams_matter) - return; - // spawn a teambubble entity if needed - if (!self.teambubbleentity && teams_matter) - { - self.teambubbleentity = spawn(); - self.teambubbleentity.owner = self; - self.teambubbleentity.exteriormodeltoclient = self; - self.teambubbleentity.think = TeamBubbleThink; - self.teambubbleentity.nextthink = time; - setmodel(self.teambubbleentity, "models/misc/teambubble.spr"); // precision set below -// setorigin(self.teambubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1'); - setorigin(self.teambubbleentity, '0 0 15' + self.maxs_z * '0 0 1'); - setattachment(self.teambubbleentity, self, ""); // sticks to moving player better, also conserves bandwidth - self.teambubbleentity.mdl = self.teambubbleentity.model; - self.teambubbleentity.model = self.teambubbleentity.mdl; - self.teambubbleentity.customizeentityforclient = TeamBubble_customizeentityforclient; - self.teambubbleentity.effects = EF_LOWPRECISION; - } -} - // LordHavoc: this hack will be removed when proper _pants/_shirt layers are // added to the model skins /*void UpdateColorModHack() @@ -2382,6 +2340,7 @@ void SpectateCopy(entity spectatee) { self.weapon = spectatee.weapon; self.nex_charge = spectatee.nex_charge; self.nex_chargepool_ammo = spectatee.nex_chargepool_ammo; + self.hagar_load = spectatee.hagar_load; self.minelayer_mines = spectatee.minelayer_mines; self.punchangle = spectatee.punchangle; self.view_ofs = spectatee.view_ofs; @@ -2627,6 +2586,8 @@ void() nexball_setstatus; .float items_added; void PlayerPreThink (void) { + WarpZone_PlayerPhysics_FixVAngle(); + self.stat_game_starttime = game_starttime; self.stat_allow_oldnexbeam = autocvar_g_allow_oldnexbeam; self.stat_leadlimit = autocvar_leadlimit; @@ -2711,13 +2672,6 @@ void PlayerPreThink (void) return; // the think tics } - if(self.teleport_time) - if(time > self.teleport_time) - { - self.teleport_time = 0; - self.effects = self.effects - (self.effects & EF_NODRAW); - } - //don't allow the player to turn around while game is paused! if(timeoutStatus == 2) { self.v_angle = self.lastV_angle; @@ -2743,7 +2697,26 @@ void PlayerPreThink (void) self.glowmod_z = -1; } else + { + // set weapon and player glowmod self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2; + + if(self.weapon == WEP_NEX && autocvar_g_balance_nex_charge) + { + self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit); + self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit); + self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit); + + if(self.nex_charge > autocvar_g_balance_nex_charge_animlimit) + { + self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit); + self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit); + self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit); + } + } + else + self.weaponentity_glowmod = self.glowmod; + } player_powerups(); } @@ -2928,7 +2901,7 @@ void PlayerPreThink (void) } if(!zoomstate_set) - SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_SNIPERRIFLE && autocvar_g_balance_sniperrifle_secondary == 0)); + SetZoomState(self.BUTTON_ZOOM || self.BUTTON_ZOOMSCRIPT || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_SNIPERRIFLE && autocvar_g_balance_sniperrifle_secondary == 0)); float oldspectatee_status; oldspectatee_status = self.spectatee_status; @@ -3069,7 +3042,6 @@ void PlayerPostThink (void) if(self.classname == "player") { CheckRules_Player(); UpdateChatBubble(); - UpdateTeamBubble(); if (self.impulse) ImpulseCommands(); if (intermission_running)