]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/models.qc
Merge branch 'z411/fix_resetmatch_scores' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / models.qc
index 44a13522a4c5b348dcf0bb224c5775b342c72292..85a8ab843620a151c774747bb3fd7001b0ff5386 100644 (file)
@@ -1,23 +1,14 @@
 #include "models.qh"
 
 #ifdef SVQC
-#include <server/defs.qh>
-#include <server/miscfunctions.qh>
-#include <common/net_linked.qh>
-#include "subs.qh"
-#include "triggers.qh"
-
-entityclass(BGMScript);
-classfield(BGMScript) .string bgmscript;
-classfield(BGMScript) .float bgmscriptattack;
-classfield(BGMScript) .float bgmscriptdecay;
-classfield(BGMScript) .float bgmscriptsustain;
-classfield(BGMScript) .float bgmscriptrelease;
-
 #include <common/constants.qh>
-#include "../../lib/csqcmodel/sv_model.qh"
-
-.float modelscale;
+#include <common/mapobjects/bgmscript.qh>
+#include <common/mapobjects/subs.qh>
+#include <common/mapobjects/triggers.qh>
+#include <common/net_linked.qh>
+#include <common/stats.qh>
+#include <common/weapons/_all.qh>
+#include <lib/csqcmodel/sv_model.qh>
 
 void g_model_setcolormaptoactivator(entity this, entity actor, entity trigger)
 {
@@ -117,11 +108,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
        if(sf & BIT(2))
        {
                if(sf & 0x10)
-               {
-                       WriteAngle(MSG_ENTITY, this.angles.x);
-                       WriteAngle(MSG_ENTITY, this.angles.y);
-                       WriteAngle(MSG_ENTITY, this.angles.z);
-               }
+                       WriteAngleVector(MSG_ENTITY, this.angles);
        }
 
        if(sf & BIT(3))
@@ -129,9 +116,9 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
                if(sf & 0x80)
                {
                        WriteShort(MSG_ENTITY, this.lodmodelindex0);
-                       WriteShort(MSG_ENTITY, bound(0, this.loddistance1, 65535));
+                       WriteShort(MSG_ENTITY, bound(0, this.loddistance1, 32767));
                        WriteShort(MSG_ENTITY, this.lodmodelindex1);
-                       WriteShort(MSG_ENTITY, bound(0, this.loddistance2, 65535));
+                       WriteShort(MSG_ENTITY, bound(0, this.loddistance2, 32767));
                        WriteShort(MSG_ENTITY, this.lodmodelindex2);
                }
                else
@@ -153,8 +140,8 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
                        WriteVector(MSG_ENTITY, this.movedir);
                        WriteByte(MSG_ENTITY, floor(this.lip * 255));
                }
-               WriteShort(MSG_ENTITY, bound(0, this.fade_start, 65535));
-               WriteShort(MSG_ENTITY, bound(0, this.fade_end, 65535));
+               WriteShort(MSG_ENTITY, bound(0, this.fade_start, 32767));
+               WriteShort(MSG_ENTITY, bound(0, this.fade_end, 32767));
                WriteByte(MSG_ENTITY, floor(this.alpha_max * 256));
                WriteByte(MSG_ENTITY, floor(this.alpha_min * 256));
                WriteByte(MSG_ENTITY, this.inactive);
@@ -168,7 +155,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
 #define G_MODEL_INIT(ent,sol) \
        if(ent.geomtype && autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \
        if(!ent.scale) ent.scale = ent.modelscale; \
-       SetBrushEntityModel(ent); \
+       SetBrushEntityModel(ent,true); \
        ent.use = g_model_setcolormaptoactivator; \
        InitializeEntity(ent, g_model_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
        if(!ent.solid) ent.solid = (sol); \
@@ -177,7 +164,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
 #define G_CLIENTMODEL_INIT(ent,sol) \
        if(ent.geomtype && autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \
        if(!ent.scale) ent.scale = ent.modelscale; \
-       SetBrushEntityModel(ent); \
+       SetBrushEntityModel(ent,true); \
        ent.use = g_clientmodel_use; \
        InitializeEntity(ent, g_clientmodel_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
        if(!ent.solid) ent.solid = (sol); \
@@ -195,11 +182,11 @@ spawnfunc(misc_models)            { this.angles_x = -this.angles.x; G_MODEL_INIT
 // non-solid brush entities:
 spawnfunc(func_illusionary)       { G_MODEL_INIT      (this, SOLID_NOT) } // Q1 name (WARNING: MISPREDICTED)
 spawnfunc(func_clientillusionary) { G_CLIENTMODEL_INIT(this, SOLID_NOT) } // brush entity
-spawnfunc(func_static)            { G_MODEL_INIT      (this, SOLID_NOT) } // DEPRECATED old alias name from some other game
 
 // solid brush entities
 spawnfunc(func_wall)              { G_MODEL_INIT      (this, SOLID_BSP) } // Q1 name
 spawnfunc(func_clientwall)        { G_CLIENTMODEL_INIT(this, SOLID_BSP) } // brush entity (WARNING: MISPREDICTED)
+spawnfunc(func_static)            { G_MODEL_INIT      (this, SOLID_BSP) } // DEPRECATED old alias name from some other game
 #elif defined(CSQC)
 .float alpha;
 .float scale;
@@ -342,11 +329,7 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
        if(f & 4)
        {
                if(f & 0x10)
-               {
-                       this.angles_x = ReadAngle();
-                       this.angles_y = ReadAngle();
-                       this.angles_z = ReadAngle();
-               }
+                       this.angles = ReadAngleVector();
                else
                        this.angles = '0 0 0';
        }