X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fclient.qc;h=328917336368c11e38341337543f0d227bf1e2c3;hp=dc3951ee9f968b34ffa4106a5294fd24c3e7588d;hb=3bbcff2475d1b2efc1314a358bf60c6fba6e4be6;hpb=0a9f0df82a38ef92a180424588c0788eaa3f3748 diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index dc3951ee9f..3289173363 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -618,9 +618,11 @@ void PutClientInServer(entity this) FixPlayermodel(this); this.drawonlytoclient = NULL; + this.viewloc = NULL; + this.crouch = false; - this.view_ofs = STAT(PL_VIEW_OFS, NULL); - setsize(this, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL)); + this.view_ofs = STAT(PL_VIEW_OFS, this); + setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this)); this.spawnorigin = spot.origin; 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 @@ -1213,6 +1215,9 @@ void ClientConnect(entity this) if (IS_REAL_CLIENT(this)) sv_notice_join(this); + // update physics stats (players can spawn before physics runs) + Physics_UpdateStats(this, PHYS_HIGHSPEED(this)); + IL_EACH(g_initforplayer, it.init_for_player, { it.init_for_player(it, this); }); @@ -1612,7 +1617,7 @@ void SetZoomState(entity this, float z) void GetPressedKeys(entity this) { MUTATOR_CALLHOOK(GetPressedKeys, this); - int keys = this.pressedkeys; + int keys = STAT(PRESSED_KEYS, this); keys = BITSET(keys, KEY_FORWARD, this.movement.x > 0); keys = BITSET(keys, KEY_BACKWARD, this.movement.x < 0); keys = BITSET(keys, KEY_RIGHT, this.movement.y > 0); @@ -1622,7 +1627,9 @@ void GetPressedKeys(entity this) keys = BITSET(keys, KEY_CROUCH, PHYS_INPUT_BUTTON_CROUCH(this)); keys = BITSET(keys, KEY_ATCK, PHYS_INPUT_BUTTON_ATCK(this)); keys = BITSET(keys, KEY_ATCK2, PHYS_INPUT_BUTTON_ATCK2(this)); - this.pressedkeys = keys; + this.pressedkeys = keys; // store for other users + + STAT(PRESSED_KEYS, this) = keys; } /* @@ -1655,7 +1662,7 @@ void SpectateCopy(entity this, entity spectatee) this.hit_time = spectatee.hit_time; this.strength_finished = spectatee.strength_finished; this.invincible_finished = spectatee.invincible_finished; - this.pressedkeys = spectatee.pressedkeys; + STAT(PRESSED_KEYS, this) = STAT(PRESSED_KEYS, spectatee); this.weapons = spectatee.weapons; this.vortex_charge = spectatee.vortex_charge; this.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo; @@ -1672,6 +1679,7 @@ void SpectateCopy(entity this, entity spectatee) this.angles = spectatee.v_angle; STAT(FROZEN, this) = STAT(FROZEN, spectatee); this.revive_progress = spectatee.revive_progress; + this.viewloc = spectatee.viewloc; if(!PHYS_INPUT_BUTTON_USE(this) && STAT(CAMERA_SPECTATOR, this) != 2) this.fixangle = true; setorigin(this, spectatee.origin);