]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use temp entities for casings instead of the delayed removal shared entity hack
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 27 Aug 2015 00:48:56 +0000 (10:48 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 27 Aug 2015 00:48:56 +0000 (10:48 +1000)
18 files changed:
qcsrc/client/casings.qc [deleted file]
qcsrc/client/casings.qh [deleted file]
qcsrc/client/controlpoint.qc
qcsrc/client/damage.qc
qcsrc/client/gibs.qc
qcsrc/client/main.qc
qcsrc/client/mutators/events.qh
qcsrc/client/prandom.qc [deleted file]
qcsrc/client/prandom.qh [deleted file]
qcsrc/client/progs.src
qcsrc/common/constants.qh
qcsrc/common/mutators/all.inc
qcsrc/common/mutators/mutator/casings.qc [new file with mode: 0644]
qcsrc/lib/_all.inc
qcsrc/lib/prandom.qc [new file with mode: 0644]
qcsrc/lib/prandom.qh [new file with mode: 0644]
qcsrc/server/g_casings.qc [deleted file]
qcsrc/server/progs.src

diff --git a/qcsrc/client/casings.qc b/qcsrc/client/casings.qc
deleted file mode 100644 (file)
index 61d7f10..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#include "casings.qh"
-#include "_all.qh"
-
-#include "../common/movetypes/movetypes.qh"
-#include "../common/weapons/all.qh"
-#include "prandom.qh"
-#include "rubble.qh"
-
-#include "../common/util.qh"
-
-.float cnt;
-.float alpha;
-.int state;
-
-entityclass(Casing);
-class(Casing) .bool silent;
-
-void Casing_Delete()
-{
-    remove(self);
-}
-
-void Casing_Draw()
-{
-       if(self.move_flags & FL_ONGROUND)
-       {
-               self.move_angles_x = 0;
-               self.move_angles_z = 0;
-               self.flags &= ~FL_ONGROUND;
-       }
-
-       Movetype_Physics_MatchTicrate(autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
-       if(wasfreed(self))
-               return; // deleted by touch function
-
-       self.renderflags = 0;
-       self.alpha = bound(0, self.cnt - time, 1);
-
-       if(self.alpha < ALPHA_MIN_VISIBLE)
-       {
-               Casing_Delete();
-               self.drawmask = 0;
-       }
-}
-
-void Casing_Touch()
-{
-       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
-       {
-               Casing_Delete();
-               return;
-       }
-
-       if(!self.silent)
-       if(!trace_ent || trace_ent.solid == SOLID_BSP)
-       {
-               if(vlen(self.velocity) > 50)
-               {
-                       if(time >= self.nextthink)
-                       {
-                               string s;
-                               int f = floor(prandom() * 3) + 1;
-
-                               switch(self.state)
-                               {
-                                       case 1:
-                                               s = W_Sound(strcat("casings", itos(f)));
-                                               break;
-                                       default:
-                                               s = W_Sound(strcat("brass", itos(f)));
-                                               break;
-                               }
-
-                               sound (self, CH_SHOTS, s, VOL_BASE, ATTEN_LARGE);
-                       }
-               }
-       }
-
-       self.nextthink = time + 0.2;
-}
-
-void Casing_Damage(float thisdmg, int hittype, vector org, vector thisforce)
-{
-       if(thisforce.z < 0)
-               thisforce.z = 0;
-       self.move_velocity = self.move_velocity + thisforce + '0 0 100';
-       self.move_flags &= ~FL_ONGROUND;
-}
-
-void Ent_Casing(float isNew)
-{
-       entity casing;
-
-       casing = RubbleNew("casing");
-       casing.state = ReadByte();
-       casing.silent = (casing.state & 0x80);
-       casing.state = (casing.state & 0x7F);
-       casing.origin_x = ReadCoord();
-       casing.origin_y = ReadCoord();
-       casing.origin_z = ReadCoord();
-       setorigin(casing, casing.origin);
-       casing.velocity = decompressShortVector(ReadShort());
-       casing.angles_x = ReadByte() * 360 / 256;
-       casing.angles_y = ReadByte() * 360 / 256;
-       casing.angles_z = ReadByte() * 360 / 256;
-       casing.drawmask = MASK_NORMAL;
-
-       if(autocvar_cl_casings && isNew) {
-               casing.draw = Casing_Draw;
-               casing.move_origin = casing.origin;
-               casing.move_velocity = casing.velocity + 2 * prandomvec();
-               casing.move_angles = casing.angles;
-               casing.move_avelocity = '0 250 0' + 100 * prandomvec();
-               casing.move_movetype = MOVETYPE_BOUNCE;
-               casing.move_touch = Casing_Touch;
-               casing.move_time = time;
-               casing.event_damage = Casing_Damage;
-               casing.solid = SOLID_TRIGGER;
-
-               switch(casing.state)
-               {
-                       case 1:
-                               setmodel(casing, "models/casing_shell.mdl");
-                               casing.cnt = time + autocvar_cl_casings_shell_time;
-                               break;
-                       default:
-                               setmodel(casing, "models/casing_bronze.iqm");
-                               casing.cnt = time + autocvar_cl_casings_bronze_time;
-                               break;
-               }
-
-               setsize(casing, '0 0 -1', '0 0 -1');
-
-               RubbleLimit("casing", autocvar_cl_casings_maxcount, Casing_Delete);
-       }
-       else
-       {
-               entity oldself = self;
-               self = casing;
-               Casing_Delete(); // yes, this IS stupid, but I don't need to duplicate all the read* stuff then
-               self = oldself;
-       }
-}
-
-void Casings_Precache()
-{
-       precache_model("models/casing_shell.mdl");
-       precache_model("models/casing_bronze.iqm");
-       precache_sound(W_Sound("brass1"));
-       precache_sound(W_Sound("brass2"));
-       precache_sound(W_Sound("brass3"));
-       precache_sound(W_Sound("casings1"));
-       precache_sound(W_Sound("casings2"));
-       precache_sound(W_Sound("casings3"));
-}
diff --git a/qcsrc/client/casings.qh b/qcsrc/client/casings.qh
deleted file mode 100644 (file)
index dafe66a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef CASINGS_H
-#define CASINGS_H
-
-void Casings_Precache();
-
-void Ent_Casing(float isNew);
-
-#endif
index a579f93aa0cfd7b3c54a9fe5c5e130c363a9fb4a..3b8901cf37695abafb9873d6daf55fd561c14a0b 100644 (file)
@@ -1,7 +1,9 @@
 #include "controlpoint.qh"
 #include "gibs.qh"
 #include "teamradar.qh"
+#include "../common/movetypes/movetypes.qh"
 
+.float alpha;
 bool cpicon_precached;
 .int count;
 .float pain_finished;
index 05d9dfe6fec0c5bbea2b1654f2a56c5ef871cfa7..5eff455c2f2929a429798a1cd4e964b11c10e1b7 100644 (file)
@@ -2,7 +2,6 @@
 #include "_all.qh"
 
 #include "gibs.qh"
-#include "prandom.qh"
 
 #include "../common/vehicles/all.qh"
 
index 298e9d5e672d61566d314cfa286d128cd8f63ce2..bdde3b698172c1b4ca08a075d3c0b97817f3e559 100644 (file)
@@ -1,7 +1,6 @@
 #include "gibs.qh"
 #include "_all.qh"
 
-#include "prandom.qh"
 #include "rubble.qh"
 
 #include "../common/constants.qh"
index da485708e8e2a6c753339cdbde1f950f537b6ab7..2309426cee16fe46b7c4d9a8f00f61aa95368a4c 100644 (file)
@@ -1,7 +1,6 @@
 #include "main.qh"
 #include "_all.qh"
 
-#include "casings.qh"
 #include "controlpoint.qh"
 #include "csqcmodel_hooks.qh"
 #include "damage.qh"
@@ -15,7 +14,6 @@
 #include "mapvoting.qh"
 #include "modeleffects.qh"
 #include "particles.qh"
-#include "prandom.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
 #include "sortlist.qh"
@@ -164,7 +162,6 @@ void CSQC_Init(void)
        Projectile_Precache();
        Hook_Precache();
        GibSplash_Precache();
-       Casings_Precache();
        Tuba_Precache();
        CSQCPlayer_Precache();
 
@@ -867,7 +864,6 @@ void CSQC_Ent_Update(float bIsNewEntity)
                case ENT_CLIENT_PROJECTILE: Ent_Projectile(); break;
                case ENT_CLIENT_GIBSPLASH: Ent_GibSplash(bIsNewEntity); break;
                case ENT_CLIENT_DAMAGEINFO: Ent_DamageInfo(bIsNewEntity); break;
-               case ENT_CLIENT_CASING: Ent_Casing(bIsNewEntity); break;
                case ENT_CLIENT_INIT: Ent_Init(); break;
                case ENT_CLIENT_SCORES_INFO: Ent_ScoresInfo(); break;
                case ENT_CLIENT_MAPVOTE: Ent_MapVote(); break;
index 86be898d9bae6942a29b43995086cd1ab23ec656..9516fd25e794788e8da9bc4c792c7a5ad6efd132 100644 (file)
@@ -40,9 +40,10 @@ MUTATOR_HOOKABLE(UpdateCrosshair, EV_NO_ARGS);
 
 /**
  * Called when a temp entity is parsed
- * NOTE: hooks MUST start with `if (MUTATOR_RETURNVALUE) return false;`
- * NOTE: hooks MUST start with `if (!ReadMutatorEquals(mutator_argv_int_0, name_of_mutator)) return false;`
- * NOTE: return true if you handled the command, return false to continue handling
+ * NOTE: hooks MUST start with:
+ *     if (MUTATOR_RETURNVALUE) return;
+ *     if (!ReadMutatorEquals(mutator_argv_int_0, name_of_mutator)) return;
+ *     return = true;
  */
 #define EV_CSQC_Parse_TempEntity(i, o) \
     /** mutator id */ i(int, mutator_argv_int_0) \
@@ -51,9 +52,9 @@ MUTATOR_HOOKABLE(CSQC_Parse_TempEntity, EV_CSQC_Parse_TempEntity);
 
 /**
  * Called when a shared entity is updated
- * NOTE: hooks MUST start with `if (MUTATOR_RETURNVALUE) return false;`
- * NOTE: hooks MUST start with `if (!ReadMutatorEquals(mutator_argv_int_0, name_of_mutator)) return false;`
- * NOTE: return true if you handled the command, return false to continue handling
+ *     if (MUTATOR_RETURNVALUE) return;
+ *     if (!ReadMutatorEquals(mutator_argv_int_0, name_of_mutator)) return;
+ *     return = true;
  */
 #define EV_CSQC_Ent_Update(i, o) \
     /** mutator id */ i(int, mutator_argv_int_0) \
diff --git a/qcsrc/client/prandom.qc b/qcsrc/client/prandom.qc
deleted file mode 100644 (file)
index 12e4e0e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "prandom.qh"
-#include "_all.qh"
-
-#include "../warpzonelib/mathlib.qh"
-
-// prandom - PREDICTABLE random number generator (not seeded yet)
-
-#ifdef USE_PRANDOM
-float prandom_seed;
-float prandom()
-{
-       float c;
-       c = crc16(false, strcat(ftos(prandom_seed), ftos(prandom_seed + M_PI)));
-       prandom_seed = c;
-
-#ifdef USE_PRANDOM_DEBUG
-       dprint("RANDOM -> ", ftos(c), "\n");
-#endif
-
-       return c / 65536; // in [0..1[
-}
-
-vector prandomvec()
-{
-       vector v;
-
-       do
-       {
-               v.x = prandom();
-               v.y = prandom();
-               v.z = prandom();
-       }
-       while(v * v > 1);
-
-       return v;
-}
-
-void psrandom(float seed)
-{
-       prandom_seed = seed;
-#ifdef USE_PRANDOM_DEBUG
-       dprint("SRANDOM ", ftos(seed), "\n");
-#endif
-}
-
-#ifdef USE_PRANDOM_DEBUG
-void prandom_debug()
-{
-       dprint("Current random seed = ", ftos(prandom_seed), "\n");
-}
-#endif
-#endif
diff --git a/qcsrc/client/prandom.qh b/qcsrc/client/prandom.qh
deleted file mode 100644 (file)
index a7653a5..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef PRANDOM_H
-#define PRANDOM_H
-
-// prandom - PREDICTABLE random number generator
-
-#define USE_PRANDOM
-
-#ifdef USE_PRANDOM
-float prandom();
-vector prandomvec();
-
-void psrandom(float seed);
-#ifdef USE_PRANDOM_DEBUG
-void prandom_debug();
-#else
-#define prandom_debug()
-#endif
-#else
-#define prandom random
-#define prandomvec randomvec
-#define psrandom(x)
-#define prandom_debug()
-#endif
-#endif
index 1b5471b94906c6c389768637951d627292cac650..6941d86daf609bbcf3a598f990c3d68ffca607da 100644 (file)
@@ -8,7 +8,6 @@
 
 announcer.qc
 bgmscript.qc
-casings.qc
 controlpoint.qc
 csqcmodel_hooks.qc
 damage.qc
@@ -26,7 +25,6 @@ movelib.qc
 noise.qc
 particles.qc
 player_skeleton.qc
-prandom.qc
 rubble.qc
 scoreboard.qc
 shownames.qc
index 70784018833aa793ac66a35cda42267ed63c5f8f..a85f09e1bfce0599aa1369265e9c547b75447e0b 100644 (file)
@@ -83,7 +83,6 @@ const int ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startco
 const int ENT_CLIENT_PROJECTILE = 12;
 const int ENT_CLIENT_GIBSPLASH = 13;
 const int ENT_CLIENT_DAMAGEINFO = 14;
-const int ENT_CLIENT_CASING = 15;
 const int ENT_CLIENT_INIT = 16;
 const int ENT_CLIENT_MAPVOTE = 17;
 const int ENT_CLIENT_CLIENTDATA = 18;
index ffdc453f1b52cffbedc87544d1884703f11df913..1d02fc371e912663710b97887f500119365a0bfd 100644 (file)
@@ -1,3 +1,4 @@
+#include "mutator/casings.qc"
 #include "mutator/damagetext.qc"
 #include "mutator/itemstime.qc"
 #include "mutator/waypoints/waypointsprites.qc"
diff --git a/qcsrc/common/mutators/mutator/casings.qc b/qcsrc/common/mutators/mutator/casings.qc
new file mode 100644 (file)
index 0000000..a9a86f8
--- /dev/null
@@ -0,0 +1,177 @@
+#include "../../util.qh"
+
+#ifdef CSQC
+#include "../../movetypes/movetypes.qh"
+#include "../../../client/rubble.qh"
+#endif
+
+REGISTER_MUTATOR(casings, true);
+
+#ifdef SVQC
+void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner)
+{
+    vector org = self.origin + self.view_ofs + self.weaponentity.spawnorigin.x * v_forward - self.weaponentity.spawnorigin.y * v_right + self.weaponentity.spawnorigin.z * v_up;
+
+    if (!sound_allowed(MSG_BROADCAST, casingowner))
+        casingtype |= 0x80;
+
+    WriteByte(MSG_ALL, SVC_TEMPENTITY);
+    WriteMutator(MSG_ALL, casings);
+    WriteByte(MSG_ALL, casingtype);
+    WriteCoord(MSG_ALL, org.x);
+    WriteCoord(MSG_ALL, org.y);
+    WriteCoord(MSG_ALL, org.z);
+    WriteShort(MSG_ALL, compressShortVector(vel)); // actually compressed velocity
+    WriteByte(MSG_ALL, ang.x * 256 / 360);
+    WriteByte(MSG_ALL, ang.y * 256 / 360);
+    WriteByte(MSG_ALL, ang.z * 256 / 360);
+}
+#endif
+
+#ifdef CSQC
+entityclass(Casing);
+class(Casing) .float alpha;
+class(Casing) .bool silent;
+class(Casing) .int state;
+class(Casing) .float cnt;
+
+void Casing_Delete()
+{
+    remove(self);
+}
+
+void Casing_Draw()
+{
+    if (self.move_flags & FL_ONGROUND)
+    {
+        self.move_angles_x = 0;
+        self.move_angles_z = 0;
+        self.flags &= ~FL_ONGROUND;
+    }
+
+    Movetype_Physics_MatchTicrate(autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
+    if (wasfreed(self))
+        return; // deleted by touch function
+
+    self.renderflags = 0;
+    self.alpha = bound(0, self.cnt - time, 1);
+
+    if (self.alpha < ALPHA_MIN_VISIBLE)
+    {
+        Casing_Delete();
+        self.drawmask = 0;
+    }
+}
+
+void Casing_Touch()
+{
+    if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
+    {
+        Casing_Delete();
+        return;
+    }
+
+    if (!self.silent)
+    if (!trace_ent || trace_ent.solid == SOLID_BSP)
+    {
+        if (vlen(self.velocity) > 50)
+        {
+            if (time >= self.nextthink)
+            {
+                string s;
+                int f = floor(prandom() * 3) + 1;
+
+                switch (self.state)
+                {
+                    case 1:
+                        s = W_Sound(strcat("casings", itos(f)));
+                        break;
+                    default:
+                        s = W_Sound(strcat("brass", itos(f)));
+                        break;
+                }
+
+                sound (self, CH_SHOTS, s, VOL_BASE, ATTEN_LARGE);
+            }
+        }
+    }
+
+    self.nextthink = time + 0.2;
+}
+
+void Casing_Damage(float thisdmg, int hittype, vector org, vector thisforce)
+{
+    if (thisforce.z < 0)
+        thisforce.z = 0;
+    self.move_velocity = self.move_velocity + thisforce + '0 0 100';
+    self.move_flags &= ~FL_ONGROUND;
+}
+
+MUTATOR_HOOKFUNCTION(casings, CSQC_Parse_TempEntity)
+{
+    if (MUTATOR_RETURNVALUE) return;
+    if (!ReadMutatorEquals(mutator_argv_int_0, casings)) return;
+    return = true;
+
+    int _state = ReadByte();
+    vector org;
+    org_x = ReadCoord();
+    org_y = ReadCoord();
+    org_z = ReadCoord();
+    vector vel = decompressShortVector(ReadShort());
+    vector ang;
+    ang_x = ReadByte() * 360 / 256;
+    ang_y = ReadByte() * 360 / 256;
+    ang_z = ReadByte() * 360 / 256;
+
+    if (!autocvar_cl_casings) return;
+
+    Casing casing = RubbleNew("casing");
+    casing.silent = (_state & 0x80);
+    casing.state = (_state & 0x7F);
+    casing.origin = org;
+    setorigin(casing, casing.origin);
+    casing.velocity = vel;
+    casing.angles = ang;
+    casing.drawmask = MASK_NORMAL;
+
+    casing.draw = Casing_Draw;
+    casing.move_origin = casing.origin;
+    casing.move_velocity = casing.velocity + 2 * prandomvec();
+    casing.move_angles = casing.angles;
+    casing.move_avelocity = '0 250 0' + 100 * prandomvec();
+    casing.move_movetype = MOVETYPE_BOUNCE;
+    casing.move_touch = Casing_Touch;
+    casing.move_time = time;
+    casing.event_damage = Casing_Damage;
+    casing.solid = SOLID_TRIGGER;
+
+    switch (casing.state)
+    {
+        case 1:
+            setmodel(casing, "models/casing_shell.mdl");
+            casing.cnt = time + autocvar_cl_casings_shell_time;
+            break;
+        default:
+            setmodel(casing, "models/casing_bronze.iqm");
+            casing.cnt = time + autocvar_cl_casings_bronze_time;
+            break;
+    }
+
+    setsize(casing, '0 0 -1', '0 0 -1');
+
+    RubbleLimit("casing", autocvar_cl_casings_maxcount, Casing_Delete);
+}
+
+STATIC_INIT(Casings)
+{
+    precache_model("models/casing_shell.mdl");
+    precache_model("models/casing_bronze.iqm");
+    precache_sound(W_Sound("brass1"));
+    precache_sound(W_Sound("brass2"));
+    precache_sound(W_Sound("brass3"));
+    precache_sound(W_Sound("casings1"));
+    precache_sound(W_Sound("casings2"));
+    precache_sound(W_Sound("casings3"));
+}
+#endif
index 5a55b538b4baad5670b5965edc86157276e98354..108790668f24eb9c5a4b708549a5b5d44e001f83 100644 (file)
@@ -5,6 +5,7 @@
 #include "Lazy.qh"
 #include "Nil.qh"
 #include "OO.qh"
+#include "prandom.qc"
 #include "Progname.qh"
 #include "Registry.qh"
 #include "test.qc"
diff --git a/qcsrc/lib/prandom.qc b/qcsrc/lib/prandom.qc
new file mode 100644 (file)
index 0000000..8b1f8d9
--- /dev/null
@@ -0,0 +1,51 @@
+#include "prandom.qh"
+
+#include "../warpzonelib/mathlib.qh"
+
+// prandom - PREDICTABLE random number generator (not seeded yet)
+
+#ifdef USE_PRANDOM
+float prandom_seed;
+float prandom()
+{
+       float c;
+       c = crc16(false, strcat(ftos(prandom_seed), ftos(prandom_seed + M_PI)));
+       prandom_seed = c;
+
+#ifdef USE_PRANDOM_DEBUG
+       dprint("RANDOM -> ", ftos(c), "\n");
+#endif
+
+       return c / 65536; // in [0..1[
+}
+
+vector prandomvec()
+{
+       vector v;
+
+       do
+       {
+               v.x = prandom();
+               v.y = prandom();
+               v.z = prandom();
+       }
+       while(v * v > 1);
+
+       return v;
+}
+
+void psrandom(float seed)
+{
+       prandom_seed = seed;
+#ifdef USE_PRANDOM_DEBUG
+       dprint("SRANDOM ", ftos(seed), "\n");
+#endif
+}
+
+#ifdef USE_PRANDOM_DEBUG
+void prandom_debug()
+{
+       dprint("Current random seed = ", ftos(prandom_seed), "\n");
+}
+#endif
+#endif
diff --git a/qcsrc/lib/prandom.qh b/qcsrc/lib/prandom.qh
new file mode 100644 (file)
index 0000000..a7653a5
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef PRANDOM_H
+#define PRANDOM_H
+
+// prandom - PREDICTABLE random number generator
+
+#define USE_PRANDOM
+
+#ifdef USE_PRANDOM
+float prandom();
+vector prandomvec();
+
+void psrandom(float seed);
+#ifdef USE_PRANDOM_DEBUG
+void prandom_debug();
+#else
+#define prandom_debug()
+#endif
+#else
+#define prandom random
+#define prandomvec randomvec
+#define psrandom(x)
+#define prandom_debug()
+#endif
+#endif
diff --git a/qcsrc/server/g_casings.qc b/qcsrc/server/g_casings.qc
deleted file mode 100644 (file)
index b9ad94e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "_all.qh"
-
-#include "../common/util.qh"
-
-float Casing_SendEntity(entity to, int sf)
-{
-       WriteByte(MSG_ENTITY, ENT_CLIENT_CASING);
-       WriteByte(MSG_ENTITY, self.state); // actually type
-       WriteCoord(MSG_ENTITY, self.origin.x);
-       WriteCoord(MSG_ENTITY, self.origin.y);
-       WriteCoord(MSG_ENTITY, self.origin.z);
-       WriteShort(MSG_ENTITY, self.oldorigin.x); // acrually compressed velocity
-       WriteByte(MSG_ENTITY, self.angles.x * 256 / 360);
-       WriteByte(MSG_ENTITY, self.angles.y * 256 / 360);
-       WriteByte(MSG_ENTITY, self.angles.z * 256 / 360);
-       return true;
-}
-
-void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner)
-{
-       entity e;
-       vector org;
-
-       org = self.origin + self.view_ofs + self.weaponentity.spawnorigin.x * v_forward - self.weaponentity.spawnorigin.y * v_right + self.weaponentity.spawnorigin.z * v_up;
-
-       if(!sound_allowed(MSG_BROADCAST, casingowner))
-               casingtype |= 0x80;
-
-       e = spawn();
-       e.state = casingtype;
-       setorigin(e, org);
-       e.velocity = vel;
-       e.angles = ang;
-       e.oldorigin_x = compressShortVector(e.velocity);
-
-       Net_LinkEntity(e, true, 0.2, Casing_SendEntity);
-               // 0.2s should be enough time for all clients to receive this ent once, do the gibbage and be done with it
-}
index 61ec76196e1d9e4a038707368bedf0f3f2c3111e..9dd0fae9b9d3bffd5cce4e5642f5e023486fd087 100644 (file)
@@ -19,7 +19,6 @@ cl_player.qc
 controlpoint.qc
 csqceffects.qc
 ent_cs.qc
-g_casings.qc
 g_damage.qc
 g_hook.qc
 // g_lights.qc // TODO: was never used