]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Declare more ints as ints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index 89647d5be241eae4bb2d68944adea631942a16fc..c0a8bde5180fd2a0c81f6544fd74928c17e9b5a2 100644 (file)
@@ -301,7 +301,7 @@ void FixPlayermodel()
        defaultskin = 0;
        chmdl = false;
 
-       if(autocvar_sv_defaultcharacter == 1)
+       if(autocvar_sv_defaultcharacter)
        {
                if(teamplay)
                {
@@ -409,7 +409,6 @@ void PutClientInServer (void)
        if(IS_PLAYER(self))
        {
                entity spot, oldself;
-               float j;
 
                accuracy_resend(self);
 
@@ -598,13 +597,13 @@ void PutClientInServer (void)
                target_voicescript_clear(self);
 
                // reset fields the weapons may use
-               for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+               for (int j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        WEP_ACTION(j, WR_RESETPLAYER);
 
                        // all weapons must be fully loaded when we spawn
                        entity e = get_weaponinfo(j);
-                       if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
+                       if (e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                                self.(weapon_load[j]) = e.reloading_ammo;
                }
 
@@ -651,7 +650,7 @@ void PutClientInServer (void)
 .float ebouncefactor, ebouncestop; // electro's values
 // TODO do we need all these fields, or should we stop autodetecting runtime
 // changes and just have a console command to update this?
-float ClientInit_SendEntity(entity to, float sf)
+float ClientInit_SendEntity(entity to, int sf)
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_INIT);
        WriteByte(MSG_ENTITY, g_nexball_meter_period * 32);
@@ -1000,7 +999,7 @@ float PlayerInIDList(entity p, string idlist)
        float n, i;
        string s;
 
-       // NOTE: we do NOT check crypto_keyfp here, an unsigned ID is fine too for this
+       // NOTE: we do NOT check crypto_idfp_signed here, an unsigned ID is fine too for this
        if (!p.crypto_idfp)
                return 0;
 
@@ -1249,6 +1248,13 @@ void ClientConnect (void)
        if(IS_REAL_CLIENT(self))
                sv_notice_join();
 
+       for (entity e = world; (e = findfloat(e, init_for_player_needed, 1)); ) {
+               entity oldself = self;
+               self = e;
+               e.init_for_player(oldself);
+               self = oldself;
+       }
+
        MUTATOR_CALLHOOK(ClientConnect);
 }
 /*