X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fclient.qc;h=45e71d5591389cdeaef0d000d44d240c16a707b1;hb=b033eeb472dde42a24c46120ea2db8591ef5213c;hp=6a978c6aebe631eef3c51e8016815a7697a24a93;hpb=e520d4b32e53462b9e22a2a923f6ba2fe2909226;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 6a978c6ae..45e71d559 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -14,6 +14,7 @@ #include "spawnpoints.qh" #include "resources.qh" #include "g_damage.qh" +#include "handicap.qh" #include "g_hook.qh" #include "command/common.qh" #include "cheats.qh" @@ -219,9 +220,20 @@ void PutObserverInServer(entity this) bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this); PlayerState_detach(this); - if (IS_PLAYER(this) && this.health >= 1) { - // despawn effect - Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1); + if (IS_PLAYER(this)) + { + if(this.health >= 1) + { + // despawn effect + Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1); + } + + // was a player, recount votes and ready status + if(IS_REAL_CLIENT(this)) + { + if (vote_called) { VoteCount(false); } + ReadyCount(); + } } { @@ -525,7 +537,6 @@ void PutPlayerInServer(entity this) this.flags |= FL_NOTARGET; this.takedamage = DAMAGE_AIM; this.effects = EF_TELEPORT_BIT | EF_RESTARTANIM_BIT; - this.dmg = 2; // WTF if (warmup_stage) { this.ammo_shells = warmup_start_ammo_shells; @@ -547,6 +558,8 @@ void PutPlayerInServer(entity this) this.health = start_health; this.armorvalue = start_armorvalue; this.weapons = start_weapons; + GiveRandomWeapons(this, random_start_weapons_count, + autocvar_g_random_start_weapons, random_start_ammo); } SetSpectatee_status(this, 0); @@ -1204,8 +1217,6 @@ void ClientConnect(entity this) CS(this).just_joined = true; // stop spamming the eventlog with additional lines when the client connects - CS(this).netname_previous = strzone(this.netname); - if(teamplay && IS_PLAYER(this)) Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_JOIN_CONNECT_TEAM), this.netname); else @@ -1272,6 +1283,8 @@ void ClientConnect(entity this) it.init_for_player(it, this); }); + Handicap_Initialize(this); + MUTATOR_CALLHOOK(ClientConnect, this); if (IS_REAL_CLIENT(this)) @@ -2479,19 +2492,22 @@ void PlayerPreThink (entity this) // WORKAROUND: only use dropclient in server frames (frametime set). // Never use it in cl_movement frames (frametime zero). checkSpectatorBlock(this); - } + } zoomstate_set = false; // Check for nameless players - if (isInvisibleString(this.netname)) { - this.netname = strzone(sprintf("Player#%d", this.playerid)); - // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe? - } - if (this.netname != CS(this).netname_previous) { - if (autocvar_sv_eventlog) { + if (this.netname == "" || this.netname != CS(this).netname_previous) + { + bool assume_unchanged = (CS(this).netname_previous == ""); + if (isInvisibleString(this.netname)) + { + this.netname = strzone(sprintf("Player#%d", this.playerid)); + assume_unchanged = false; + // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe? + } + if (!assume_unchanged && autocvar_sv_eventlog) GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this, false))); - } if (CS(this).netname_previous) strunzone(CS(this).netname_previous); CS(this).netname_previous = strzone(this.netname); } @@ -2650,7 +2666,6 @@ void DrownPlayer(entity this) if(this.air_finished < time) PlayerSound(this, playersound_gasp, CH_PLAYER, VOL_BASE, VOICETYPE_PLAYERSOUND); this.air_finished = time + autocvar_g_balance_contents_drowndelay; - this.dmg = 2; } else if (this.air_finished < time) { // drown!