]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_models.qc
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_models.qc
index 363650ce8c097d9e710d68d0fea885bd4d8f870b..1026e3aa7a2dfaa6b0a139c3ad75eca12e141f94 100644 (file)
@@ -1,6 +1,9 @@
 #include "g_models.qh"
 
+#include <server/defs.qh>
+#include <server/miscfunctions.qh>
 #include "g_subs.qh"
+#include <common/net_linked.qh>
 #include "../common/triggers/subs.qh"
 #include "../common/triggers/triggers.qh"
 
@@ -98,13 +101,12 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
        {
                if(sf & 0x40)
                        WriteShort(MSG_ENTITY, this.colormap);
+               WriteByte(MSG_ENTITY, this.skin);
        }
 
        if(sf & BIT(1))
        {
-               WriteCoord(MSG_ENTITY, this.origin.x);
-               WriteCoord(MSG_ENTITY, this.origin.y);
-               WriteCoord(MSG_ENTITY, this.origin.z);
+               WriteVector(MSG_ENTITY, this.origin);
        }
 
        if(sf & BIT(2))
@@ -133,12 +135,8 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
                WriteShort(MSG_ENTITY, floor(this.scale * 256));
                if(sf & 0x20)
                {
-                       WriteCoord(MSG_ENTITY, this.mins.x);
-                       WriteCoord(MSG_ENTITY, this.mins.y);
-                       WriteCoord(MSG_ENTITY, this.mins.z);
-                       WriteCoord(MSG_ENTITY, this.maxs.x);
-                       WriteCoord(MSG_ENTITY, this.maxs.y);
-                       WriteCoord(MSG_ENTITY, this.maxs.z);
+                       WriteVector(MSG_ENTITY, this.mins);
+                       WriteVector(MSG_ENTITY, this.maxs);
                }
                WriteString(MSG_ENTITY, this.bgmscript);
                if(this.bgmscript != "")
@@ -147,16 +145,14 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
                        WriteByte(MSG_ENTITY, floor(this.bgmscriptdecay * 64));
                        WriteByte(MSG_ENTITY, floor(this.bgmscriptsustain * 255));
                        WriteByte(MSG_ENTITY, floor(this.bgmscriptrelease * 64));
-                       WriteCoord(MSG_ENTITY, this.movedir.x);
-                       WriteCoord(MSG_ENTITY, this.movedir.y);
-                       WriteCoord(MSG_ENTITY, this.movedir.z);
+                       WriteVector(MSG_ENTITY, this.movedir);
                        WriteByte(MSG_ENTITY, floor(this.lip * 255));
                }
-               WriteShort(MSG_ENTITY, this.fade_start);
-               WriteShort(MSG_ENTITY, this.fade_end);
-               WriteShort(MSG_ENTITY, this.alpha_max);
-               WriteShort(MSG_ENTITY, this.alpha_min);
-               WriteShort(MSG_ENTITY, this.inactive);
+               WriteByte(MSG_ENTITY, this.fade_start);
+               WriteByte(MSG_ENTITY, this.fade_end);
+               WriteByte(MSG_ENTITY, this.alpha_max);
+               WriteByte(MSG_ENTITY, this.alpha_min);
+               WriteByte(MSG_ENTITY, this.inactive);
                WriteShort(MSG_ENTITY, this.fade_vertical_offset);
        }
 
@@ -165,17 +161,17 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
 
 
 #define G_MODEL_INIT(ent,sol) \
-       if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) ent.movetype = MOVETYPE_PHYSICS; \
+       if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \
        if(!ent.scale) ent.scale = ent.modelscale; \
-       SetBrushEntityModel(); \
+       SetBrushEntityModel(ent); \
        ent.use = g_model_setcolormaptoactivator; \
        InitializeEntity(ent, g_model_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
        if(!ent.solid) ent.solid = (sol); else if(ent.solid < 0) ent.solid = SOLID_NOT;
 
 #define G_CLIENTMODEL_INIT(ent,sol) \
-       if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) ent.movetype = MOVETYPE_PHYSICS; \
+       if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \
        if(!ent.scale) ent.scale = ent.modelscale; \
-       SetBrushEntityModel(); \
+       SetBrushEntityModel(ent); \
        ent.use = g_clientmodel_use; \
        InitializeEntity(ent, g_clientmodel_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
        if(!ent.solid) ent.solid = (sol); else if(ent.solid < 0) ent.solid = SOLID_NOT; \