]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Merge branch 'terencehill/bot_ai' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index ed7c36a37b1fe0b80ee1cc7146b6b653f56281dc..bffd503e5e27de3cf4f6eb6bdecb01adc149e5a2 100644 (file)
@@ -558,8 +558,11 @@ void PutPlayerInServer(entity this)
                this.health = start_health;
                this.armorvalue = start_armorvalue;
                this.weapons = start_weapons;
-               GiveRandomWeapons(this, random_start_weapons_count,
-                       autocvar_g_random_start_weapons, random_start_ammo);
+               if (MUTATOR_CALLHOOK(ForbidRandomStartWeapons, this) == false)
+               {
+                       GiveRandomWeapons(this, random_start_weapons_count,
+                               autocvar_g_random_start_weapons, random_start_ammo);
+               }
        }
        SetSpectatee_status(this, 0);
 
@@ -636,7 +639,6 @@ void PutPlayerInServer(entity this)
        setorigin(this, spot.origin + '0 0 1' * (1 - this.mins.z - 24));
        // don't reset back to last position, even if new position is stuck in solid
        this.oldorigin = this.origin;
-       this.lastteleporttime = time; // prevent insane speeds due to changing origin
        if(this.conveyor)
                IL_REMOVE(g_conveyed, this);
        this.conveyor = NULL; // prevent conveyors at the previous location from moving a freshly spawned player
@@ -654,9 +656,11 @@ void PutPlayerInServer(entity this)
 
        PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
 
+       // player was spectator
        if (CS(this).killcount == FRAGS_SPECTATOR) {
                PlayerScore_Clear(this);
                CS(this).killcount = 0;
+               CS(this).startplaytime = time;
        }
 
        for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)