X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fclient.qc;h=d4a3e9febfa359aef00e37995c6b56961d0a8a25;hp=b563f354f972c6d568f4469dc0458ff6c6ec28b6;hb=451e02a2857d8c671f6dcf6a0639ea7c609b3ba9;hpb=e1bfe1d1d43ac7adedba945d692b37e0aafc453b diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index b563f354f..d4a3e9feb 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -36,6 +36,7 @@ #include "weapons/weaponsystem.qh" #include "../common/net_notice.qh" +#include "../common/net_linked.qh" #include "../common/physics/player.qh" #include "../common/items/_mod.qh" @@ -235,7 +236,7 @@ void PutObserverInServer(entity this) this.angles_z = 0; this.fixangle = true; // offset it so that the spectator spawns higher off the ground, looks better this way - setorigin(this, spot.origin + STAT(PL_VIEW_OFS, NULL)); + setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this)); this.prevorigin = this.origin; if (IS_REAL_CLIENT(this)) { @@ -252,7 +253,7 @@ void PutObserverInServer(entity this) FixPlayermodel(this); } setmodel(this, MDL_Null); - setsize(this, STAT(PL_CROUCH_MIN, NULL), STAT(PL_CROUCH_MAX, NULL)); + setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this)); this.view_ofs = '0 0 0'; } @@ -283,8 +284,8 @@ void PutObserverInServer(entity this) if (this.killcount != FRAGS_SPECTATOR) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, this.netname); - if(!intermission_running) - if(autocvar_g_chat_nospectators == 1 || (!(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2)) + if(!gameover) + if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2)) Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS); if(this.just_joined == false) { @@ -338,6 +339,7 @@ void PutObserverInServer(entity this) this.hook_time = 0; this.deadflag = DEAD_NO; this.crouch = false; + this.revive_progress = 0; this.revival_time = 0; this.items = 0; @@ -615,6 +617,7 @@ void PutClientInServer(entity this) this.strength_finished = 0; this.invincible_finished = 0; this.fire_endtime = -1; + this.revive_progress = 0; this.revival_time = 0; this.air_finished = time + 12; @@ -1049,8 +1052,8 @@ ClientPreConnect Called once (not at each match start) when a client begins a connection to the server ============= */ -void ClientPreConnect () -{ENGINE_EVENT(); +void ClientPreConnect(entity this) +{ if(autocvar_sv_eventlog) { GameLogEcho(sprintf(":connect:%d:%d:%s", @@ -1189,12 +1192,6 @@ void ClientConnect(entity this) if (IS_REAL_CLIENT(this)) { - if (!autocvar_g_campaign) - { - this.motd_actived_time = -1; - Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage(this)); - } - if (g_weaponarena_weapons == WEPSET(TUBA)) stuffcmd(this, "cl_cmd settemp chase_active 1\n"); } @@ -1221,6 +1218,15 @@ void ClientConnect(entity this) }); MUTATOR_CALLHOOK(ClientConnect, this); + + if (IS_REAL_CLIENT(this)) + { + if (!autocvar_g_campaign && !IS_PLAYER(this)) + { + this.motd_actived_time = -1; + Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage(this)); + } + } } /* ============= @@ -1604,11 +1610,11 @@ void player_regen(entity this) } bool zoomstate_set; -void SetZoomState(entity this, float z) +void SetZoomState(entity this, float newzoom) { - if(z != this.zoomstate) + if(newzoom != this.zoomstate) { - this.zoomstate = z; + this.zoomstate = newzoom; ClientData_Touch(this); } zoomstate_set = true; @@ -2314,8 +2320,9 @@ void PlayerPreThink (entity this) if (IS_PLAYER(this)) { CheckRules_Player(this); - if (intermission_running) { - IntermissionThink(this); + if (gameover || intermission_running) { + if(intermission_running) + IntermissionThink(this); return; } @@ -2466,8 +2473,9 @@ void PlayerPreThink (entity this) this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime); } - else if (gameover) { - if (intermission_running) IntermissionThink(this); + else if (gameover || intermission_running) { + if(intermission_running) + IntermissionThink(this); return; } else if (IS_OBSERVER(this)) { @@ -2609,13 +2617,23 @@ void PlayerPostThink (entity this) CheatFrame(this); //CheckPlayerJump(); + if (gameover) + { + this.solid = SOLID_NOT; + this.takedamage = DAMAGE_NO; + set_movetype(this, MOVETYPE_NONE); + } if (IS_PLAYER(this)) { DrownPlayer(this); CheckRules_Player(this); UpdateChatBubble(this); if (this.impulse) ImpulseCommands(this); - if (intermission_running) return; // intermission or finale + if (gameover) + { + CSQCMODEL_AUTOUPDATE(this); + return; + } GetPressedKeys(this); }