X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fclient.qc;h=478ffaca9e22a62d0ee8e18416de451b65757bb5;hb=5a956b40964e8c4a74208fe74cc04f48983f0d65;hp=f573a1d650ab32a3f8ddd967258f85b81b37e9a6;hpb=bd84ca6fa3aa22e2100db210e7a4d7de8442d71f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index f573a1d65..478ffaca9 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -231,7 +231,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)) { @@ -248,7 +248,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'; } @@ -279,7 +279,7 @@ void PutObserverInServer(entity this) if (this.killcount != FRAGS_SPECTATOR) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, this.netname); - if(!gameover) + if(!game_stopped) if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2)) Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS); @@ -343,10 +343,6 @@ void PutObserverInServer(entity this) this.weaponmodel = ""; for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { - if(!this.weaponentities[slot]) - continue; // first load - this.weaponentities[slot].hook_time = 0; - this.weaponentities[slot].weaponname = ""; this.weaponentities[slot] = NULL; } this.exteriorweaponentity = NULL; @@ -358,6 +354,15 @@ void PutObserverInServer(entity this) this.oldvelocity = this.velocity; this.fire_endtime = -1; this.event_damage = func_null; + + for(int slot = 0; slot < MAX_AXH; ++slot) + { + entity axh = this.(AuxiliaryXhair[slot]); + this.(AuxiliaryXhair[slot]) = NULL; + + if(axh.owner == this && axh != NULL && !wasfreed(axh)) + delete(axh); + } } int player_getspecies(entity this) @@ -488,9 +493,8 @@ void PutClientInServer(entity this) WriteByte(MSG_ONE, SVC_SETVIEW); WriteEntity(MSG_ONE, this); } - if (gameover) { + if (game_stopped) TRANSMUTE(Observer, this); - } SetSpectatee(this, NULL); @@ -658,7 +662,10 @@ void PutClientInServer(entity this) for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { .entity weaponentity = weaponentities[slot]; + entity oldwep = this.(weaponentity); CL_SpawnWeaponentity(this, weaponentity); + if(oldwep && oldwep.owner == this) + this.(weaponentity).m_gunalign = oldwep.m_gunalign; } this.alpha = default_player_alpha; this.colormod = '1 1 1' * autocvar_g_player_brightness; @@ -711,6 +718,8 @@ void PutClientInServer(entity this) this.(weaponentity).cnt = -1; } + MUTATOR_CALLHOOK(PlayerWeaponSelect, this); + if (!warmup_stage && !this.alivetime) this.alivetime = time; @@ -873,7 +882,7 @@ void ClientKill_Now(entity this) } void KillIndicator_Think(entity this) { - if (gameover) + if (game_stopped) { this.owner.killindicator = NULL; delete(this); @@ -917,16 +926,14 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change, float killtime; float starttime; - if (gameover) + if (game_stopped) return; killtime = autocvar_g_balance_kill_delay; - if(g_race_qualifying || g_cts) - killtime = 0; - if(MUTATOR_CALLHOOK(ClientKill, this, killtime)) return; + killtime = M_ARGV(1, float); this.killindicator_teamchange = targetteam; @@ -1009,7 +1016,7 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change, void ClientKill (entity this) { - if(gameover) return; + if(game_stopped) return; if(this.player_blocked) return; if(STAT(FROZEN, this)) return; @@ -1147,7 +1154,7 @@ void ClientConnect(entity this) if (IS_BOT_CLIENT(this)) PlayerStats_GameReport_AddPlayer(this); if (autocvar_sv_eventlog) - GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", this.netname)); + GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", playername(this, false))); LogTeamchange(this.playerid, this.team, 1); @@ -1205,7 +1212,7 @@ void ClientConnect(entity this) stuffcmd(this, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n")); if (autocvar_sv_teamnagger && !(autocvar_bot_vs_human && AvailableTeams() == 2)) - if (!g_ca && !g_cts && !g_race) // teamnagger is currently bad for ca, race & cts + if(!MUTATOR_CALLHOOK(HideTeamNagger, this)) send_CSQC_teamnagger(); CSQCMODEL_AUTOINIT(this); @@ -1256,7 +1263,8 @@ void ClientDisconnect(entity this) Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_DISCONNECT, this.netname); - SetSpectatee(this, NULL); + if(IS_SPEC(this)) + SetSpectatee(this, NULL); MUTATOR_CALLHOOK(ClientDisconnect, this); @@ -1391,7 +1399,7 @@ void player_powerups(entity this) // add a way to see what the items were BEFORE all of these checks for the mutator hook int items_prev = this.items; - if((this.items & IT_USING_JETPACK) && !IS_DEAD(this) && !gameover) + if((this.items & IT_USING_JETPACK) && !IS_DEAD(this) && !game_stopped) this.modelflags |= MF_ROCKET; else this.modelflags &= ~MF_ROCKET; @@ -1673,6 +1681,7 @@ void SpectateCopy(entity this, entity spectatee) this.hit_time = spectatee.hit_time; this.strength_finished = spectatee.strength_finished; this.invincible_finished = spectatee.invincible_finished; + this.superweapons_finished = spectatee.superweapons_finished; STAT(PRESSED_KEYS, this) = STAT(PRESSED_KEYS, spectatee); this.weapons = spectatee.weapons; this.vortex_charge = spectatee.vortex_charge; @@ -1703,6 +1712,11 @@ void SpectateCopy(entity this, entity spectatee) this.(weaponentity) = spectatee.(weaponentity); } + for(int slot = 0; slot < MAX_AXH; ++slot) + { + this.(AuxiliaryXhair[slot]) = spectatee.(AuxiliaryXhair[slot]); + } + anticheat_spectatecopy(this, spectatee); this.hud = spectatee.hud; if(spectatee.vehicle) @@ -2155,7 +2169,7 @@ void PlayerUseKey(entity this) if(this.vehicle) { - if(!gameover) + if(!game_stopped) { vehicles_exit(this.vehicle, VHEF_NORMAL); return; @@ -2165,7 +2179,7 @@ void PlayerUseKey(entity this) { if(!STAT(FROZEN, this)) if(!IS_DEAD(this)) - if(!gameover) + if(!game_stopped) { entity head, closest_target = NULL; head = WarpZone_FindRadius(this.origin, autocvar_g_vehicles_enter_radius, true); @@ -2238,7 +2252,7 @@ void PlayerPreThink (entity this) } if (this.netname != this.netname_previous) { if (autocvar_sv_eventlog) { - GameLogEcho(strcat(":name:", ftos(this.playerid), ":", this.netname)); + GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this, false))); } if (this.netname_previous) strunzone(this.netname_previous); this.netname_previous = strzone(this.netname); @@ -2296,7 +2310,7 @@ void PlayerPreThink (entity this) MUTATOR_CALLHOOK(PlayerPreThink, this); - if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !gameover && !this.vehicle) + if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !game_stopped && !this.vehicle) if(IS_PLAYER(this) && !STAT(FROZEN, this) && !IS_DEAD(this)) { FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_vehicles_enter_radius, IS_VEHICLE(it), @@ -2331,7 +2345,8 @@ void PlayerPreThink (entity this) if (IS_PLAYER(this)) { CheckRules_Player(this); - if (gameover || intermission_running) { + if (game_stopped || intermission_running) { + this.modelflags &= ~MF_ROCKET; if(intermission_running) IntermissionThink(this); return; @@ -2418,8 +2433,18 @@ void PlayerPreThink (entity this) this.prevorigin = this.origin; + bool have_hook = false; + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity weaponentity = weaponentities[slot]; + if(this.(weaponentity).hook.state) + { + have_hook = true; + break; + } + } bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this); - if (this.hook.state) { + if (have_hook) { do_crouch = false; } else if (this.waterlevel >= WATERLEVEL_SWIMMING) { do_crouch = false; @@ -2492,7 +2517,7 @@ void PlayerPreThink (entity this) this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime); } - else if (gameover || intermission_running) { + else if (game_stopped || intermission_running) { if(intermission_running) IntermissionThink(this); return; @@ -2644,7 +2669,7 @@ void PlayerPostThink (entity this) CheatFrame(this); //CheckPlayerJump(); - if (gameover) + if (game_stopped) { this.solid = SOLID_NOT; this.takedamage = DAMAGE_NO; @@ -2656,7 +2681,7 @@ void PlayerPostThink (entity this) CheckRules_Player(this); UpdateChatBubble(this); if (this.impulse) ImpulseCommands(this); - if (gameover) + if (game_stopped) { CSQCMODEL_AUTOUPDATE(this); return;