X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_client.qc;h=08c53c19403bc819372fbe97c3138750f236e5bc;hp=8a3fe88fd54ef39d6eb4de33f658417e57f7fba7;hb=7be1d49d63370b86c0f1e1bcfb661f4f32b4bdfd;hpb=84cbc40e52e9af30f9af69f9848f46bcf0571264 diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 8a3fe88fd5..08c53c1940 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/") @@ -508,7 +515,6 @@ float Client_customizeentityforclient() return TRUE; } -void UpdatePlayerSounds(); void setmodel_lod(entity e, string modelname) { string s; @@ -933,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; @@ -1059,19 +1066,55 @@ float ClientInit_SendEntity(entity to, float sf) WriteCoord(MSG_ENTITY, hook_shotorigin_x); WriteCoord(MSG_ENTITY, hook_shotorigin_y); WriteCoord(MSG_ENTITY, hook_shotorigin_z); - if(sv_foginterval && world.fog != "") WriteString(MSG_ENTITY, world.fog); else WriteString(MSG_ENTITY, ""); - WriteByte(MSG_ENTITY, cvar("g_balance_armor_blockpercent") * 255.0); - WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0); + WriteByte(MSG_ENTITY, self.count * 255.0); // g_balance_armor_blockpercent + WriteByte(MSG_ENTITY, self.cnt * 255.0); // g_balance_weaponswitchdelay + WriteCoord(MSG_ENTITY, self.bouncefactor); // g_balance_grenadelauncher_secondary_bouncefactor + WriteCoord(MSG_ENTITY, self.bouncestop); // g_balance_grenadelauncher_secondary_bouncestop return TRUE; } +void ClientInit_CheckUpdate() +{ + self.nextthink = time; + if(self.count != cvar("g_balance_armor_blockpercent")) + { + self.count = cvar("g_balance_armor_blockpercent"); + self.SendFlags |= 1; + } + if(self.cnt != cvar("g_balance_weaponswitchdelay")) + { + self.cnt = cvar("g_balance_weaponswitchdelay"); + self.SendFlags |= 1; + } + if(self.bouncefactor != cvar("g_balance_grenadelauncher_secondary_bouncefactor")) + { + self.bouncefactor = cvar("g_balance_grenadelauncher_secondary_bouncefactor"); + self.SendFlags |= 1; + } + if(self.bouncestop != cvar("g_balance_grenadelauncher_secondary_bouncestop")) + { + self.bouncestop = cvar("g_balance_grenadelauncher_secondary_bouncestop"); + self.SendFlags |= 1; + } +} + void ClientInit_Spawn() { - Net_LinkEntity(spawn(), FALSE, 0, ClientInit_SendEntity); + entity o; + entity e; + e = spawn(); + e.classname = "clientinit"; + e.think = ClientInit_CheckUpdate; + Net_LinkEntity(e, FALSE, 0, ClientInit_SendEntity); + + o = self; + self = e; + ClientInit_CheckUpdate(); + self = o; } /* @@ -1351,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; @@ -2612,7 +2659,6 @@ void PlayerPreThink (void) FOR_EACH_PLAYER(other) if(self != other) { if(time > other.touchexplode_time) - if(other.classname == "player") if(other.deadflag == DEAD_NO) if not(IS_INDEPENDENT_PLAYER(other)) if(boxesoverlap(self.absmin, self.absmax, other.absmin, other.absmax)) @@ -2801,6 +2847,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 @@ -2902,6 +2960,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(); /*