]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/csqcmodel/sv_model.qc
Merge branch 'terencehill/eraseable_functions'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / csqcmodel / sv_model.qc
index dc2e4021fbc405283e1de904b13b9546ebbc648a..0ff4389944c03dcda8f0756cb0dba5d21d43fef5 100644 (file)
 #include "sv_model.qh"
 
 #include "common.qh"
-#include <common/animdecide.qh>
-#include <common/constants.qh>
-#include <common/util.qh>
-#include <server/constants.qh>
-#include <server/defs.qh>
 
 // generic CSQC model code
 
-bool CSQCModel_Send(entity to, int sf)
+bool CSQCModel_Send(entity this, entity to, int sf)
 {
-    SELFPARAM();
        // some nice flags for CSQCMODEL_IF
        noref bool isplayer = IS_CLIENT(this);
        noref bool islocalplayer = (this == to);
@@ -65,13 +59,9 @@ bool CSQCModel_Send(entity to, int sf)
 void CSQCModel_CheckUpdate(entity e)
 {
        // some nice flags for CSQCMODEL_IF
-       float isplayer = IS_CLIENT(e);
-       float islocalplayer = isplayer; // we set BOTH to 1 here as we need the sendflags
-       float isnolocalplayer = isplayer; // we set BOTH to 1 here as we need the sendflags
-
-       unused_float = isplayer;
-       unused_float = islocalplayer;
-       unused_float = isnolocalplayer;
+       noref float isplayer = IS_CLIENT(e);
+       noref float islocalplayer = isplayer; // we set BOTH to 1 here as we need the sendflags
+       noref float isnolocalplayer = isplayer; // we set BOTH to 1 here as we need the sendflags
 
 #if CSQCPLAYER_FORCE_UPDATES
        if(isplayer && time > e.csqcmodel_nextforcedupdate)
@@ -122,12 +112,12 @@ void CSQCModel_CheckUpdate(entity e)
 
 void CSQCModel_LinkEntity(entity e)
 {
-       e.SendEntity = CSQCModel_Send;
+       setSendEntity(e, CSQCModel_Send);
        e.SendFlags = 0xFFFFFF;
        CSQCModel_CheckUpdate(e);
 }
 
 void CSQCModel_UnlinkEntity(entity e)
 {
-       e.SendEntity = func_null;
+       setSendEntity(e, func_null);
 }