]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Merge remote branch 'refs/remotes/origin/divVerent/tag_seeker'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index 8a3fe88fd54ef39d6eb4de33f658417e57f7fba7..c4b8bb600ab8faa86251f23ac5a743d05f4759c7 100644 (file)
@@ -1059,19 +1059,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;
 }
 
 /*