]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/csqcmodel/cl_model.qc
Merge branch 'master' into Mario/hagar_notfixed
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / csqcmodel / cl_model.qc
index 53b58e6297be9dc07e6d6cfd72c8e2cbd5799d45..789f115d14ac960b3c361bac06ce8229e7960e0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Rudolf PolzerCSQCModel_InterpolateAnimation_2To4_PreNote
+ * Copyright (c) 2011 Rudolf Polzer
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -192,7 +192,7 @@ void CSQCModel_Draw(entity this)
 
        CSQCModel_InterpolateAnimation_Do(this);
 
-       { CSQCMODEL_HOOK_PREDRAW }
+       CSQCModel_Hook_PreDraw(this, isplayer);
 
        // inherit draw flags easily
        entity root = this;
@@ -220,21 +220,21 @@ NET_HANDLE(ENT_CLIENT_MODEL, bool isnew)
        int sf = ReadInt24_t();
 
        // some nice flags for CSQCMODEL_IF and the hooks
-       bool isplayer = (this.entnum >= 1 && this.entnum <= maxclients);
+       bool isplayer = ReadByte() || (this.entnum >= 1 && this.entnum <= maxclients);
        if (isnew && isplayer)
        {
                CSQCModel_players[this.entnum - 1] = this;
                this.entremove = CSQCModel_remove;
        }
        bool islocalplayer = (this.entnum == player_localnum + 1);
-       noref bool isnolocalplayer = (isplayer && (this.entnum != player_localnum + 1));
+       noref bool isnolocalplayer = (isplayer && !islocalplayer);
 
        this.classname = "csqcmodel";
        this.iflags |= IFLAG_ORIGIN; // interpolate origin too
        this.iflags |= IFLAG_ANGLES; // interpolate angles too
        this.iflags |= IFLAG_VELOCITY | IFLAG_AUTOVELOCITY; // let's calculate velocity automatically
 
-       { CSQCMODEL_HOOK_PREUPDATE }
+       CSQCModel_Hook_PreUpdate(this, isnew, isplayer, islocalplayer);
 
        CSQCPlayer_PreUpdate(this);
        InterpolateOrigin_Undo(this);
@@ -271,7 +271,7 @@ NET_HANDLE(ENT_CLIENT_MODEL, bool isnew)
        InterpolateOrigin_Note(this);
        CSQCPlayer_PostUpdate(this);
 
-       { CSQCMODEL_HOOK_POSTUPDATE }
+       CSQCModel_Hook_PostUpdate(this, isnew, isplayer, islocalplayer);
 
 #ifdef CSQCMODEL_SUPPORT_GETTAGINFO_BEFORE_DRAW
        InterpolateOrigin_Do(this);