X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_client.qc;h=73c9169e5e6929341cca72c4f50377ec92c32125;hb=7478ee65e419e5cbd39978693820f451ad3c0754;hp=ba363f0c0a273e32914981baea57a9b7fa30cd1c;hpb=af2e8eaf7acf9e7069a64280c1d6be29859d59ba;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index ba363f0c0..73c9169e5 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -398,8 +398,15 @@ Checks if the argument string can be a valid playermodel. Returns a valid one in doubt. ============= */ -string FallbackPlayerModel = "models/player/marine.zym"; +string FallbackPlayerModel; string CheckPlayerModel(string plyermodel) { + if(FallbackPlayerModel != cvar_defstring("_cl_playermodel")) + { + // note: we cannot summon Don Strunzone here, some player may + // still have the model string set. In case anyone manages how + // to change a cvar default, we'll have a small leak here. + FallbackPlayerModel = strzone(cvar_defstring("_cl_playermodel")); + } if(strlen(plyermodel) < 4) return FallbackPlayerModel; if( substring(plyermodel,0,14) != "models/player/") @@ -932,6 +939,7 @@ void PutClientInServer (void) self.nextthink = 0; self.hook_time = 0; self.dmg_team = 0; + self.ballistics_density = cvar("g_ballistics_density_player"); self.metertime = 0; @@ -1386,6 +1394,10 @@ void ClientConnect (void) DecodeLevelParms(); +#ifdef WATERMARK + sprint(self, strcat("^4SVQC Build information: ", WATERMARK(), "\n")); +#endif + self.classname = "player_joining"; self.flags = FL_CLIENT; @@ -2836,6 +2848,18 @@ Called every frame for each client after the physics are run ============= */ .float idlekick_lasttimeleft; +.entity showheadshotbbox; +void showheadshotbbox_think() +{ + if(self.owner.showheadshotbbox != self) + { + remove(self); + return; + } + self.nextthink = time; + setorigin(self, self.owner.origin); + setsize(self, GetHeadshotMins(self.owner), GetHeadshotMaxs(self.owner)); +} void PlayerPostThink (void) { // Savage: Check for nameless players @@ -2937,6 +2961,26 @@ void PlayerPostThink (void) if(self.waypointsprite_attachedforcarrier) WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, cvar("g_balance_armor_blockpercent"))); + if(self.classname == "player" && self.deadflag == DEAD_NO && cvar("r_showbboxes")) + { + if(!self.showheadshotbbox) + { + self.showheadshotbbox = spawn(); + self.showheadshotbbox.classname = "headshotbbox"; + self.showheadshotbbox.owner = self; + self.showheadshotbbox.think = showheadshotbbox_think; + self.showheadshotbbox.nextthink = time; + self = self.showheadshotbbox; + self.think(); + self = self.owner; + } + } + else + { + if(self.showheadshotbbox) + remove(self.showheadshotbbox); + } + playerdemo_write(); /*