]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix invisible devastator rockets
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 12 Jun 2016 04:01:13 +0000 (14:01 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 12 Jun 2016 04:01:13 +0000 (14:01 +1000)
qcsrc/common/mutators/mutator/physical_items/physical_items.qc
qcsrc/common/t_items.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/lib/csqcmodel/sv_model.qc
qcsrc/lib/net.qh
qcsrc/lib/self.qh
qcsrc/server/g_subs.qc
qcsrc/server/weapons/csqcprojectile.qc

index fed70ef7d11a30feafe6ae3e866c9e9cfcf20b5a..7bd1687af597676b8a90e7d980218be984a36753 100644 (file)
@@ -136,6 +136,6 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn)
        item.effects |= EF_NODRAW; // hide the original weapon
        item.movetype = MOVETYPE_FOLLOW;
        item.aiment = wep; // attach the original weapon
-       item.SendEntity3 = func_null;
+       setSendEntity(item, func_null);
 }
 #endif
index 0829464d22fb763e0d93b1146f11bb8fbb84c467..06c2f064fecb5d8f4b91d263863aad9e583d7fa0 100644 (file)
@@ -356,7 +356,7 @@ void ItemUpdate(entity this)
 
 void UpdateItemAfterTeleport(entity this)
 {
-       if(this.SendEntity3 == ItemSend)
+       if(getSendEntity(this) == ItemSend)
                ItemUpdate(this);
 }
 
index ba3d02577f29d36126fadf06b15192f2cbcc21ba..e85e868a6594ee85e3ecccaac45642094a8f163a 100644 (file)
@@ -625,7 +625,7 @@ METHOD(Racer, vr_spawn, void(Racer thisveh, entity instance))
 METHOD(Racer, vr_death, void(Racer thisveh, entity instance))
 {
 #ifdef SVQC
-    instance.SendEntity                = func_null; // stop networking this racer (for now)
+    setSendEntity(instance, func_null); // stop networking this racer (for now)
     instance.health                    = 0;
     instance.event_damage      = func_null;
     instance.solid                     = SOLID_CORPSE;
index fe3a19a0b4bbe56e1e509bc893aa70f07701c2b6..bc4b609bf2b692154f840149eea1797e6611c06c 100644 (file)
@@ -349,15 +349,12 @@ void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float d
 
 void W_Devastator_Attack(Weapon thiswep, entity actor)
 {
-       entity missile;
-       entity flash;
-
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(devastator, ammo));
 
        W_SetupShot_ProjectileSize(actor, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage));
        Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
-       missile = WarpZone_RefSys_SpawnSameRefSys(actor);
+       entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);
        missile.owner = missile.realowner = actor;
        actor.lastrocket = missile;
        if(WEP_CVAR(devastator, detonatedelay) >= 0)
@@ -394,7 +391,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor)
        CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
 
        // muzzle flash for 1st person view
-       flash = spawn();
+       entity flash = spawn();
        setmodel(flash, MDL_DEVASTATOR_MUZZLEFLASH); // precision set below
        SUB_SetFade(flash, time, 0.1);
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
index 2d0e5eb0947ef0cf30047a138ea6939f1408faa5..d495ae0154e58bd297d3de76de2c4eb7c8aed761 100644 (file)
@@ -128,6 +128,5 @@ void CSQCModel_LinkEntity(entity e)
 
 void CSQCModel_UnlinkEntity(entity e)
 {
-       e.SendEntity = func_null;
-       e.SendEntity3 = func_null;
+       setSendEntity(e, func_null);
 }
index 507807919ac9d6bbf0425b1dd03ea4f1b3c691d8..4e09d4b01043363a619153154f90dd08baf5ba6d 100644 (file)
@@ -97,9 +97,6 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 
        .int Version;  // deprecated, use SendFlags
        .int SendFlags;
-       .bool(entity to, int sendflags) SendEntity;
-       /** return false to remove from the client */
-       .bool(entity this, entity to, int sendflags) SendEntity3;
 
        void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
        {
@@ -127,7 +124,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 
        void Net_UnlinkEntity(entity e)
        {
-               e.SendEntity = func_null;
+               setSendEntity(e, func_null);
        }
 
        .void(entity this) uncustomizeentityforclient;
index 37f0c50d21297a79a0b133e879e39ebd4aaa1baa..ec43a34022592ae86b5c0c26ec23c5005ffcc938 100644 (file)
@@ -84,8 +84,10 @@ SELFWRAP(customizeentityforclient, bool, (), (entity this), (this))
 SELFWRAP(camera_transform, vector, (vector org, vector ang), (entity this, vector org, vector ang), (this, org, ang))
 #define setcamera_transform(e, f) SELFWRAP_SET(camera_transform, e, f)
 
+/** return false to remove from the client */
 SELFWRAP(SendEntity, bool, (entity to, int sendflags), (entity this, entity to, int sendflags), (this, to, sendflags))
 #define setSendEntity(e, f) SELFWRAP_SET(SendEntity, e, f)
+#define getSendEntity(e) SELFWRAP_GET(SendEntity, e)
 
 #define ChangeYaw(e, ...) (__self = (e), builtin_ChangeYaw(__VA_ARGS__))
 #define checkclient(e, ...) (__self = (e), builtin_checkclient(__VA_ARGS__))
index d4463f6939531ef7da9561b4c3afa082a4237dc9..e2b7ba269bbb70146aa347b664104cea37ad899c 100644 (file)
@@ -321,7 +321,7 @@ void LODmodel_attach(entity this)
        }
 
        if(this.lodmodelindex1)
-               if (!this.SendEntity)
+               if (!getSendEntity(this))
                        SetCustomizer(this, LOD_customize, LOD_uncustomize);
 }
 
index 0edf22664ae8eba7e89fff4851c5c98001019b17..7e7478e9b8ea8aedd9e71f0b49f839084849bf93 100644 (file)
@@ -98,13 +98,13 @@ void CSQCProjectile(entity e, float clientanimate, int type, float docull)
 
 void UpdateCSQCProjectile(entity e)
 {
-       if(e.SendEntity3 == CSQCProjectile_SendEntity)
+       if(getSendEntity(e) == CSQCProjectile_SendEntity)
        {
                // send new origin data
                e.SendFlags |= 0x01;
        }
 // FIXME HACK
-       else if(e.SendEntity3 == ItemSend)
+       else if(getSendEntity(e) == ItemSend)
        {
                ItemUpdate(e);
        }
@@ -113,7 +113,7 @@ void UpdateCSQCProjectile(entity e)
 
 void UpdateCSQCProjectileAfterTeleport(entity e)
 {
-       if(e.SendEntity3 == CSQCProjectile_SendEntity)
+       if(getSendEntity(e) == CSQCProjectile_SendEntity)
        {
                // send new origin data
                e.SendFlags |= 0x01;