// recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
if(this.tag_entity.classname == "csqcmodel")
{
- CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.isplayermodel & ISPLAYER_ENT));
+ CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.isplayermodel & ISPLAYER_CLIENT));
}
if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex)
.entity hook;
// TODO
- #define IS_CLIENT(s) (((s).isplayermodel & ISPLAYER_ENT) || (s) == csqcplayer)
- #define IS_PLAYER(s) ((s).isplayermodel & ISPLAYER_ENT)
+ #define IS_CLIENT(s) (((s).isplayermodel & ISPLAYER_CLIENT) || (s) == csqcplayer)
+ #define IS_PLAYER(s) ((s).isplayermodel & ISPLAYER_PLAYER)
#define IS_NOT_A_CLIENT(s) (!(s).isplayermodel && (s) != csqcplayer)
#define isPushable(s) ((s).isplayermodel || (s).pushable || ((s).flags & FL_PROJECTILE))
void CSQCModel_Draw(entity this)
{
// some nice flags for CSQCMODEL_IF and the hooks
- bool isplayer = (this.entnum >= 1 && this.entnum <= maxclients);
+ bool isplayer = (this.isplayermodel & ISPLAYER_CLIENT);
noref bool islocalplayer = (this.entnum == player_localnum + 1);
noref bool isnolocalplayer = (isplayer && (this.entnum != player_localnum + 1));
int psf = ReadByte();
// some nice flags for CSQCMODEL_IF and the hooks
- bool isplayer = (psf & ISPLAYER_ENT) || (this.entnum >= 1 && this.entnum <= maxclients);
+ bool isplayer = (psf & ISPLAYER_CLIENT) || (this.entnum >= 1 && this.entnum <= maxclients);
if (isnew && isplayer)
{
CSQCModel_players[this.entnum - 1] = this;
bool islocalplayer = (this.entnum == player_localnum + 1);
noref bool isnolocalplayer = (isplayer && !islocalplayer);
- this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_ENT, isplayer);
+ this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_CLIENT, isplayer);
this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_LOCAL, islocalplayer);
+ this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_PLAYER, (psf & ISPLAYER_PLAYER));
this.classname = "csqcmodel";
this.iflags |= IFLAG_ORIGIN; // interpolate origin too
.float lerpfrac;
const int ISPLAYER_MODEL = BIT(0); // using a player model
-const int ISPLAYER_ENT = BIT(1); // is an actual player
+const int ISPLAYER_CLIENT = BIT(1); // is a client
const int ISPLAYER_LOCAL = BIT(2); // is the local player
+const int ISPLAYER_PLAYER = BIT(3); // is a player in the match
const int CSQCMODEL_PROPERTY_FRAME = BIT(23);
const int CSQCMODEL_PROPERTY_TELEPORTED = BIT(22); // the "teleport bit" cancelling interpolation
noref bool isnolocalplayer = (isplayer && (this != to));
int psf = 0;
- psf = BITSET(psf, ISPLAYER_ENT, isplayer);
+ psf = BITSET(psf, ISPLAYER_CLIENT, isplayer);
psf = BITSET(psf, ISPLAYER_LOCAL, islocalplayer);
+ psf = BITSET(psf, ISPLAYER_PLAYER, IS_PLAYER(this));
WriteHeader(MSG_ENTITY, ENT_CLIENT_MODEL);
WriteInt24_t(MSG_ENTITY, sf);