From: Mario Date: Thu, 8 Feb 2018 13:24:16 +0000 (+1000) Subject: Alternative way of making auxiliary crosshairs spectatable X-Git-Tag: xonotic-v0.8.5~2335 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2d3d069401a83bf8ee3e23724994b777738cc3b8;p=xonotic%2Fxonotic-data.pk3dir.git Alternative way of making auxiliary crosshairs spectatable --- diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 1fbd80210..0cd864c38 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -26,8 +26,8 @@ bool SendAuxiliaryXhair(entity this, entity to, int sf) bool AuxiliaryXhair_customize(entity this, entity client) { - //entity e = WaypointSprite_getviewentity(client); - entity axh = client.(AuxiliaryXhair[this.cnt]); + entity e = WaypointSprite_getviewentity(client); + entity axh = e.(AuxiliaryXhair[this.cnt]); return axh.owner == this.owner; // cheaply check if the client's axh owner is the same as our real owner } diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 749e59f14..c460f9dde 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -357,14 +357,6 @@ void PutObserverInServer(entity this) //this.spawnpoint_targ = NULL; // keep it so they can return to where they were? - for(int slot = 0; slot < MAX_AXH; ++slot) - { - entity axh = this.(AuxiliaryXhair[slot]); - this.(AuxiliaryXhair[slot]) = NULL; - if(axh && axh.owner == this) - delete(axh); - } - this.weaponmodel = ""; for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { @@ -649,16 +641,17 @@ void PutPlayerInServer(entity this) this.viewloc = NULL; - this.spawnpoint_targ = NULL; - for(int slot = 0; slot < MAX_AXH; ++slot) { entity axh = this.(AuxiliaryXhair[slot]); this.(AuxiliaryXhair[slot]) = NULL; - if(axh && axh.owner == this) + + if(axh.owner == this && axh != NULL && !wasfreed(axh)) delete(axh); } + this.spawnpoint_targ = NULL; + this.crouch = false; this.view_ofs = STAT(PL_VIEW_OFS, this); setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this)); @@ -1811,11 +1804,6 @@ void SpectateCopy(entity this, entity spectatee) this.(weaponentity) = spectatee.(weaponentity); } - for(int slot = 0; slot < MAX_AXH; ++slot) - { - this.(AuxiliaryXhair[slot]) = spectatee.(AuxiliaryXhair[slot]); - } - anticheat_spectatecopy(this, spectatee); this.hud = spectatee.hud; if(spectatee.vehicle)