]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/wall.qc
Tweak the accidentally pushed CSQC model LOD support to work with large models
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / wall.qc
index 7b610fb9fa56c6420ae0e7c7bb4a2fa703f680c5..b5728095485406213273f68f387c6096761de206 100644 (file)
@@ -1,5 +1,7 @@
 #include "wall.qh"
 
+#include "autocvars.qh"
+#include "main.qh"
 #include "bgmscript.qh"
 
 
@@ -9,8 +11,8 @@
 .float scale;
 .vector movedir;
 
-void Ent_Wall_PreDraw()
-{SELFPARAM();
+void Ent_Wall_PreDraw(entity this)
+{
        if (this.inactive)
        {
                this.alpha = 0;
@@ -136,13 +138,12 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
                        this.colormap = ReadShort();
                else
                        this.colormap = 0;
+               this.skin = ReadByte();
        }
 
        if(f & 2)
        {
-               this.origin_x = ReadCoord();
-               this.origin_y = ReadCoord();
-               this.origin_z = ReadCoord();
+               this.origin = ReadVector();
                setorigin(this, this.origin);
        }
 
@@ -178,12 +179,8 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
                this.scale = ReadShort() / 256.0;
                if(f & 0x20)
                {
-                       this.mins_x = ReadCoord();
-                       this.mins_y = ReadCoord();
-                       this.mins_z = ReadCoord();
-                       this.maxs_x = ReadCoord();
-                       this.maxs_y = ReadCoord();
-                       this.maxs_z = ReadCoord();
+                       this.mins = ReadVector();
+                       this.maxs = ReadVector();
                }
                else
                        this.mins = this.maxs = '0 0 0';
@@ -208,16 +205,14 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
                        this.bgmscriptdecay = ReadByte() / 64.0;
                        this.bgmscriptsustain = ReadByte() / 255.0;
                        this.bgmscriptrelease = ReadByte() / 64.0;
-                       this.movedir_x = ReadCoord();
-                       this.movedir_y = ReadCoord();
-                       this.movedir_z = ReadCoord();
+                       this.movedir = ReadVector();
                        this.lip = ReadByte() / 255.0;
                }
-               this.fade_start = ReadShort();
-               this.fade_end = ReadShort();
-               this.alpha_max = ReadShort();
-               this.alpha_min = ReadShort();
-               this.inactive = ReadShort();
+               this.fade_start = ReadByte();
+               this.fade_end = ReadByte();
+               this.alpha_max = ReadByte();
+               this.alpha_min = ReadByte();
+               this.inactive = ReadByte();
                this.fade_vertical_offset = ReadShort();
                BGMScript_InitEntity(this);
        }
@@ -230,5 +225,6 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
 
        this.entremove = Ent_Wall_Remove;
        this.draw = Ent_Wall_Draw;
-       this.predraw = Ent_Wall_PreDraw;
+       if (isnew) IL_PUSH(g_drawables, this);
+       setpredraw(this, Ent_Wall_PreDraw);
 }