diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 410a27144..0bd7d1c75 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -151,15 +151,7 @@ CL_ParseDelta(const entity_xstate_t *from, entity_xstate_t *to, int number, int if (bits & U_FM_FLAGS) { - to->rr_mesh = 0; - for (int i = 0; i < MAX_FM_MESH_NODES; i++) - { - to->fmnodeinfo[i].flags = MSG_ReadShort(&net_message); - if (to->fmnodeinfo[i].flags & FMNI_NO_DRAW) - { - to->rr_mesh |= (1 << i); - } - } + to->rr_mesh = MSG_ReadLong(&net_message); } if (cls.serverProtocol != PROTOCOL_VERSION) diff --git a/src/common/movemsg.c b/src/common/movemsg.c index 60bee3e09..b594fc05e 100644 --- a/src/common/movemsg.c +++ b/src/common/movemsg.c @@ -617,10 +617,9 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from, bits |= U_SOUND; } - for (int i = 0; i < MAX_FM_MESH_NODES; i++) + if (to->rr_mesh != from->rr_mesh) { - if (to->fmnodeinfo[i].flags != from->fmnodeinfo[i].flags) - bits |= U_FM_FLAGS; + bits |= U_FM_FLAGS; } /* write the message */ @@ -657,10 +656,7 @@ MSG_WriteDeltaEntity(const entity_xstate_t *from, if (bits & U_FM_FLAGS) { - for (int i = 0; i < MAX_FM_MESH_NODES; i++) - { - MSG_WriteShort(msg, to->fmnodeinfo[i].flags); - } + MSG_WriteLong(msg, to->rr_mesh); } if (IS_QII97_PROTOCOL(protocol)) diff --git a/src/game/character/ai.c b/src/game/character/ai.c index 34d49c086..dfa366be2 100644 --- a/src/game/character/ai.c +++ b/src/game/character/ai.c @@ -147,7 +147,7 @@ void c_swapplayer(edict_t *Self,edict_t *Cinematic) for (i=0;is.fmnodeinfo[i].flags = Self->s.fmnodeinfo[i].flags; + Cinematic->s.fmnodeinfo[i].flags = Self->s.fmnodeinfo[i].flags; Cinematic->s.fmnodeinfo[i].skin = Self->s.fmnodeinfo[i].skin; } @@ -172,6 +172,7 @@ void c_swapplayer(edict_t *Self,edict_t *Cinematic) Cinematic->s.fmnodeinfo[MESH__HELSTF].flags |= FMNI_NO_DRAW; Cinematic->s.fmnodeinfo[MESH__BOWACTV].flags |= FMNI_NO_DRAW; Cinematic->s.fmnodeinfo[MESH__STAFACTV].flags |= FMNI_NO_DRAW; + Cinematic->rrs.mesh = GenNoDrawInfo(Cinematic->s.fmnodeinfo); } #define ENT_INVISIBLE 1 diff --git a/src/game/character/dranor/dranor.c b/src/game/character/dranor/dranor.c index c669b5ef2..ce977a796 100644 --- a/src/game/character/dranor/dranor.c +++ b/src/game/character/dranor/dranor.c @@ -186,5 +186,5 @@ void SP_character_dranor (edict_t *self) self->s.fmnodeinfo[MESH__HOE].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__GAFF].flags |= FMNI_NO_DRAW; self->health = 30; - + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); } diff --git a/src/game/character/elflord/elflord.c b/src/game/character/elflord/elflord.c index 3106d1598..1abdda7c1 100644 --- a/src/game/character/elflord/elflord.c +++ b/src/game/character/elflord/elflord.c @@ -159,6 +159,8 @@ void Elflord_c_anims(edict_t *self, G_Message_t *msg) return; } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); + SetAnim(self, curr_anim); } diff --git a/src/game/effects/main.c b/src/game/effects/main.c index 7b489cb57..ac8f58892 100644 --- a/src/game/effects/main.c +++ b/src/game/effects/main.c @@ -652,15 +652,7 @@ AddServerEntities(frame_t *frame) } // Handle flex-model nodes. - - ent->rr_mesh = 0; - for (int i = 0; i < MAX_FM_MESH_NODES; i++) - { - if (s1->fmnodeinfo[i].flags & FMNI_NO_DRAW) - { - ent->rr_mesh |= (1 << i); - } - } + ent->rr_mesh = s1->rr_mesh; // What's going on here? // jmarshall - removed legacy prediction. diff --git a/src/game/g_obj.c b/src/game/g_obj.c index 2e7f8733b..bf9086931 100644 --- a/src/game/g_obj.c +++ b/src/game/g_obj.c @@ -708,6 +708,7 @@ void SpawnCorpse(edict_t *self) self->s.fmnodeinfo[MESH__HAMMER].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__HOE].flags |= FMNI_NO_DRAW; } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); VectorSet(self->mins,-30,-12,-2); VectorSet(self->maxs,30,12,2); @@ -956,6 +957,8 @@ void SP_obj_dying_elf(edict_t *self) self->s.fmnodeinfo[MESH__HAMMER].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__HANDLE].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); + self->s.frame = FRAME_fetal1; self->think = dying_elf_idle; self->nextthink = level.time + FRAMETIME; diff --git a/src/game/g_utils.c b/src/game/g_utils.c index c6316aab4..7ffffc08b 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -1274,3 +1274,19 @@ newfindradius(edict_t *from, vec3_t org, float rad) return NULL; } + +unsigned +GenNoDrawInfo(fmnodeinfo_t *fmnodeinfo) +{ + unsigned rr_mesh = 0; + int i; + + for(i = 0; i < MAX_FM_MESH_NODES; i++) + { + if (fmnodeinfo[i].flags & FMNI_NO_DRAW) + { + rr_mesh |= (1 << i); + } + } + return rr_mesh; +} diff --git a/src/game/header/local.h b/src/game/header/local.h index 634e75019..8ea920cab 100644 --- a/src/game/header/local.h +++ b/src/game/header/local.h @@ -2484,6 +2484,7 @@ qboolean Pickup_Sphere(edict_t * ent, edict_t * other); #define WALL_ENTITY (struct edict_s *)1 #define AVG_VEC3T(scale) (((scale)[0] + (scale)[1] + (scale)[2]) / 3) +unsigned GenNoDrawInfo(fmnodeinfo_t *fmnodeinfo); void G_CPrintf(edict_t* ent, int printlevel, short stringid); void G_BCaption(int printlevel, short stringid); void G_LevelMsgCenterPrintf(edict_t* ent, short msg); diff --git a/src/game/monster/assassin/assassin.c b/src/game/monster/assassin/assassin.c index dd9ce9031..7a28f6324 100644 --- a/src/game/monster/assassin/assassin.c +++ b/src/game/monster/assassin/assassin.c @@ -523,6 +523,8 @@ void assassindagger (edict_t *self, float right_ofs) } } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); + if(thrownum>1) gi.sound (self, CHAN_WEAPON, Sounds[SND_THROW2], 1, ATTN_NORM, 0); else if(thrownum>0) @@ -664,6 +666,7 @@ void assassin_death(edict_t *self, G_Message_t *msg) self->s.fmnodeinfo[MESH__RUPARM].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__LKNIFE].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__RKNIFE].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); SprayDebris(self, self->s.origin, 12, 100); } @@ -871,6 +874,7 @@ qboolean canthrownode_as (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode_as[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } return false; @@ -897,6 +901,8 @@ void assassin_dropweapon (edict_t *self, int whichknives) ThrowWeapon(self, &handspot, BIT_RKNIFE, 0, FRAME_prtfly);//FRAME_atakc3); self->s.fmnodeinfo[MESH__RKNIFE].flags |= FMNI_NO_DRAW; } + + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); } int assassin_convert_hitloc_dead(int hl) @@ -1310,7 +1316,7 @@ void assassin_dismember(edict_t *self, int damage, int HitLocation) break; } - if(self->s.fmnodeinfo[MESH__L4ARM].flags&FMNI_NO_DRAW&& + if(self->s.fmnodeinfo[MESH__L4ARM].flags&FMNI_NO_DRAW && self->s.fmnodeinfo[MESH__R4ARM].flags&FMNI_NO_DRAW) { self->monsterinfo.aiflags |= AI_COWARD; @@ -1408,6 +1414,7 @@ void assassin_pause (edict_t *self) //this gets stuck on, sometimes self->s.fmnodeinfo[MESH__LKNIFE].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__RKNIFE].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); if(self->monsterinfo.aiflags&AI_OVERRIDE_GUIDE) return; @@ -2079,6 +2086,7 @@ void assassinCrouchedCheckAttack (edict_t *self, float attack) void assassinNodeOn (edict_t *self, float node) { self->s.fmnodeinfo[(int)node].flags &= ~FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); } void assassinStop (edict_t *self) @@ -2947,6 +2955,7 @@ void SP_monster_assassin (edict_t *self) self->svflags |= SVF_WAIT_NOTSOLID; self->s.fmnodeinfo[MESH__KNIFES].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); VectorCopy(self->s.origin, self->pos1); } diff --git a/src/game/monster/gkrokon/gkrokon.c b/src/game/monster/gkrokon/gkrokon.c index 5bd4375af..8040542bb 100644 --- a/src/game/monster/gkrokon/gkrokon.c +++ b/src/game/monster/gkrokon/gkrokon.c @@ -710,6 +710,7 @@ qboolean canthrownode_gk (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode_gk[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } return false; diff --git a/src/game/monster/harpy/harpy.c b/src/game/monster/harpy/harpy.c index 530268474..35bdeee19 100644 --- a/src/game/monster/harpy/harpy.c +++ b/src/game/monster/harpy/harpy.c @@ -872,6 +872,8 @@ void harpy_dismember(edict_t *self, int damage, int HitLocation) break; } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); + if (HitLocation == hl_rwing || HitLocation == hl_lwing || HitLocation == hl_head) { self->monsterinfo.jump_time = level.time + 2; @@ -1713,5 +1715,6 @@ SP_monster_harpy(edict_t *self) if(irand(0,2)) self->s.fmnodeinfo[MESH_TAILSPIKES].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); gi.linkentity(self); } diff --git a/src/game/monster/mssithra/mssithra.c b/src/game/monster/mssithra/mssithra.c index 643cb343c..76f62e7dd 100644 --- a/src/game/monster/mssithra/mssithra.c +++ b/src/game/monster/mssithra/mssithra.c @@ -786,6 +786,7 @@ void SP_monster_mssithra (edict_t *self) //Turn the goofy bolts off! self->s.fmnodeinfo[MESH__BOLTS].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); self->dmg = 0; self->svflags|=SVF_BOSS; diff --git a/src/game/monster/ogle/ogle.c b/src/game/monster/ogle/ogle.c index c8529a6f7..087bec5dd 100644 --- a/src/game/monster/ogle/ogle.c +++ b/src/game/monster/ogle/ogle.c @@ -197,6 +197,7 @@ void SP_obj_corpse_ogle(edict_t *self) self->s.fmnodeinfo[MESH__PICK].flags |= FMNI_NO_DRAW; } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); ObjectInit(self,40,80,MAT_FLESH,SOLID_BBOX); } @@ -507,6 +508,7 @@ void ogle_cast_off_tools_of_oppression ( edict_t *self ) ThrowWeapon(self, &vec3_origin, throw_nodes, 0, 0); } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); self->monsterinfo.aiflags |= AI_NO_MELEE; } @@ -1185,6 +1187,8 @@ void ogle_dismember(edict_t *self, int damage, int HitLocation) self->s.fmnodeinfo[MESH__RLEG].skin = self->s.skinnum+1; break; } + + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); } void ogle_death_pain(edict_t *self, G_Message_t *msg) @@ -1857,6 +1861,8 @@ void SP_monster_ogle(edict_t *self) self->s.fmnodeinfo[MESH__PICK].flags |= FMNI_NO_DRAW; } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); + if (self->monsterinfo.ogleflags & OF_CINEMATIC) { self->svflags|=SVF_FLOAT; diff --git a/src/game/monster/plagueelf/plagueelf.c b/src/game/monster/plagueelf/plagueelf.c index 7e34d8274..c8db90e74 100644 --- a/src/game/monster/plagueelf/plagueelf.c +++ b/src/game/monster/plagueelf/plagueelf.c @@ -867,6 +867,7 @@ qboolean canthrownode_pe (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode_pe[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } return false; @@ -932,6 +933,7 @@ qboolean plagueElf_dropweapon (edict_t *self, int damage) self->s.fmnodeinfo[MESH__HANDLE].flags |= FMNI_NO_DRAW; plagueElf_chicken(self,4,8,flrand(3,8)); } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } if(!(self->s.fmnodeinfo[MESH__GAFF].flags & FMNI_NO_DRAW)) @@ -949,6 +951,7 @@ qboolean plagueElf_dropweapon (edict_t *self, int damage) self->s.fmnodeinfo[MESH__HANDLE].flags |= FMNI_NO_DRAW; plagueElf_chicken(self,4,8,flrand(3,8)); } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } if(!(self->s.fmnodeinfo[MESH__HAMMER].flags & FMNI_NO_DRAW)) @@ -966,10 +969,12 @@ qboolean plagueElf_dropweapon (edict_t *self, int damage) self->s.fmnodeinfo[MESH__HANDLE].flags |= FMNI_NO_DRAW; plagueElf_chicken(self,4,8,flrand(3,8)); } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } ThrowWeapon(self, &handspot, BIT_HANDLE, 0, FRAME_partfly); self->s.fmnodeinfo[MESH__HANDLE].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); if(self->deadflag != DEAD_DEAD) plagueElf_chicken(self,6,8,flrand(5,10)); return true; @@ -2095,6 +2100,7 @@ void SP_monster_plagueElf (edict_t *self) self->monsterinfo.aiflags |= AI_NO_MISSILE; } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); self->monsterinfo.supporters = -1; //set up my mood function diff --git a/src/game/monster/plaguessithra/plaguessithra.c b/src/game/monster/plaguessithra/plaguessithra.c index 467011e3d..ea8c4d5d8 100644 --- a/src/game/monster/plaguessithra/plaguessithra.c +++ b/src/game/monster/plaguessithra/plaguessithra.c @@ -1271,8 +1271,11 @@ void ssithraSplit (edict_t *self, int BodyPart) } } tophalf->s.fmnodeinfo[MESH__CAPBOTTOMUPPERTORSO].flags &= ~FMNI_NO_DRAW; + tophalf->rrs.mesh = GenNoDrawInfo(tophalf->s.fmnodeinfo); + self->s.fmnodeinfo[MESH__CAPLOWERTORSO].flags &= ~FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__RIGHT2SPIKE].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); self->nextthink = 9999999999999999.0f; } @@ -1300,6 +1303,7 @@ qboolean canthrownode (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } return false; @@ -1455,8 +1459,9 @@ void ssithra_dismember(edict_t *self, int damage, int HitLocation) canthrownode(self, MESH__RIGHT2SPIKE,&throw_nodes); self->s.fmnodeinfo[MESH__CAPTOPUPPERTORSO].flags &= ~FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); - gore_spot[2]+=18; + gore_spot[2] += 18; ThrowBodyPart(self, &gore_spot, throw_nodes, damage, 0); VectorAdd(self->s.origin, gore_spot, gore_spot); @@ -1518,6 +1523,7 @@ void ssithra_dismember(edict_t *self, int damage, int HitLocation) //seal up the caps left by this split self->s.fmnodeinfo[MESH__CAPBOTTOMUPPERTORSO].flags &= ~FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__CAPLOWERTORSO].flags &= ~FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); canthrownode(self, MESH__UPPERTORSO,&throw_nodes); canthrownode(self, MESH__CAPBOTTOMUPPERTORSO,&throw_nodes); @@ -3157,6 +3163,7 @@ void SP_monster_ssithra (edict_t *self) alpha = false; } } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); self->s.color[3] = 255; if(alpha)//tough guy! diff --git a/src/game/monster/seraph/seraph.c b/src/game/monster/seraph/seraph.c index bfbab9396..b9a88917e 100644 --- a/src/game/monster/seraph/seraph.c +++ b/src/game/monster/seraph/seraph.c @@ -756,6 +756,7 @@ qboolean canthrownode_so (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode_so[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } return false; @@ -776,6 +777,7 @@ void seraph_dropweapon (edict_t *self) VectorMA(handspot,12,up,handspot); ThrowWeapon(self, &handspot, BIT_WHIP, 0, FRAME_partfly); self->s.fmnodeinfo[MESH__WHIP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return; } } @@ -1101,6 +1103,7 @@ void SP_monster_seraph_overlord(edict_t *self) self->s.fmnodeinfo[MESH__LHANDGRD].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__ARMSPIKES].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__SHOULDPAD].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); MG_InitMoods(self); diff --git a/src/game/monster/seraph/seraph_guard.c b/src/game/monster/seraph/seraph_guard.c index 96bc2fae2..d0576636b 100644 --- a/src/game/monster/seraph/seraph_guard.c +++ b/src/game/monster/seraph/seraph_guard.c @@ -855,6 +855,7 @@ qboolean canthrownode_sg (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode_sg[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } return false; @@ -875,6 +876,7 @@ void seraph_guard_dropweapon (edict_t *self) VectorMA(handspot,12,up,handspot); ThrowWeapon(self, &handspot, BIT_AXE, 0, FRAME_partfly); self->s.fmnodeinfo[MESH__AXE].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return; } } @@ -1246,6 +1248,7 @@ void SP_monster_seraph_guard(edict_t *self) self->s.fmnodeinfo[MESH__WHIP].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__LHANDBOSS].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__PITHEAD].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); self->s.frame = FRAME_idle; @@ -1304,6 +1307,7 @@ void SP_monster_seraph_guard(edict_t *self) self->s.fmnodeinfo[MESH__WHIP].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__LHANDBOSS].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__PITHEAD].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); MG_InitMoods(self); diff --git a/src/game/monster/spreader/spreader.c b/src/game/monster/spreader/spreader.c index 3632f36a7..4a6744d63 100644 --- a/src/game/monster/spreader/spreader.c +++ b/src/game/monster/spreader/spreader.c @@ -106,6 +106,7 @@ void spreader_showgrenade(edict_t *self) return;//fixme: actually prevent these anims self->s.fmnodeinfo[MESH__BOMB].flags &= ~FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); } void spreader_pain_sound(edict_t *self) @@ -151,6 +152,7 @@ void spreader_idlenoise(edict_t *self) void spreader_hidegrenade(edict_t *self) { self->s.fmnodeinfo[MESH__BOMB].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); gi.sound(self, CHAN_AUTO, sounds[SND_THROW], 1, ATTN_IDLE, 0); } @@ -709,6 +711,7 @@ qboolean canthrownode_ps (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode_ps[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } return false; @@ -727,6 +730,7 @@ void spreader_dropweapon (edict_t *self) VectorMA(handspot, -12, right, handspot); ThrowWeapon(self, &handspot, BIT_BOMB, 0, 0); self->s.fmnodeinfo[MESH__BOMB].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); } void spreader_dead_pain (edict_t *self, G_Message_t *msg) @@ -967,6 +971,7 @@ void spreader_isblocked (edict_t *self, trace_t *trace) self->s.fmnodeinfo[MESH__HEAD].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); VectorCopy(self->s.origin, gore_spot); gore_spot[2]+=self->maxs[2] - 8; SprayDebris(self, gore_spot, 8, 100); @@ -1331,6 +1336,7 @@ void SP_monster_spreader (edict_t *self) self->s.modelindex = classStatics[CID_SPREADER].resInfo->modelIndex; self->s.fmnodeinfo[MESH__BOMB].flags |= FMNI_NO_DRAW; //hide the bomb + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); self->ai_mood_flags |= AI_MOOD_FLAG_PREDICT; diff --git a/src/game/monster/spreader/spreadermist.c b/src/game/monster/spreader/spreadermist.c index d13719edf..e4acc6a70 100644 --- a/src/game/monster/spreader/spreadermist.c +++ b/src/game/monster/spreader/spreadermist.c @@ -156,6 +156,7 @@ static void spreader_grenade_explode (edict_t *self) self->bounced = NULL; self->isBlocked = NULL; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); // self->think = G_FreeEdict; // self->nextthink = level.time + self->delay; } diff --git a/src/game/monster/tcheckrik/tcheckrik.c b/src/game/monster/tcheckrik/tcheckrik.c index a5e95e6e9..142a36ea1 100644 --- a/src/game/monster/tcheckrik/tcheckrik.c +++ b/src/game/monster/tcheckrik/tcheckrik.c @@ -755,6 +755,7 @@ qboolean canthrownode_tc (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode_tc[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return true; } return false; @@ -800,6 +801,7 @@ void insect_dropweapon (edict_t *self, int weapon) ThrowWeapon(self, &handspot, BIT_STAFF, 0, FRAME_partfly); self->s.fmnodeinfo[MESH__STAFF].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__GEM].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); // insect_chicken(self,2,4,flrand(3,8)); return; } @@ -811,6 +813,7 @@ void insect_dropweapon (edict_t *self, int weapon) ThrowWeapon(self, &handspot, BIT_SPEAR, 0, FRAME_partfly); self->s.fmnodeinfo[MESH__SPEAR].flags |= FMNI_NO_DRAW; // insect_chicken(self,2,4,flrand(3,8)); + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return; } if((!weapon || weapon&BIT_SWORD)&& @@ -824,6 +827,7 @@ void insect_dropweapon (edict_t *self, int weapon) self->s.fmnodeinfo[MESH__MALEHAND].flags |= FMNI_NO_DRAW; // self->s.fmnodeinfo[MESH__SWORD].flags |= FMNI_NO_DRAW; // insect_chicken(self,2,4,flrand(3,8)); + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); return; } } @@ -1173,7 +1177,8 @@ void insect_pain(edict_t *self, G_Message_t *msg) /*------------------------------------------------------------------------- insect_pause -------------------------------------------------------------------------*/ -void insect_pause (edict_t *self) +void +insect_pause(edict_t *self) { vec3_t v; float len; @@ -1206,6 +1211,8 @@ void insect_pause (edict_t *self) } } + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); + if(self->monsterinfo.aiflags&AI_OVERRIDE_GUIDE) { if(self->groundentity) @@ -1703,6 +1710,8 @@ void SP_monster_tcheckrik_male (edict_t *self) if(self->spawnflags & MSF_INSECT_BEAST_FODDER) self->s.fmnodeinfo[MESH__MALEHAND].flags |= FMNI_NO_DRAW;//? + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); + //FIXME (somewhere: otherenemy should be more than just *one* kind self->monsterinfo.otherenemyname = "monster_rat"; @@ -1865,6 +1874,7 @@ void SP_monster_tcheckrik_female (edict_t *self) // self->s.fmnodeinfo[MESH__GEM].flags |= FMNI_NO_DRAW; + self->rrs.mesh = GenNoDrawInfo(self->s.fmnodeinfo); //FIXME (somewhere: otherenemy should be more than just *one* kind self->monsterinfo.otherenemyname = "monster_rat"; diff --git a/src/game/player/client.c b/src/game/player/client.c index dc2752e77..19d82dd63 100644 --- a/src/game/player/client.c +++ b/src/game/player/client.c @@ -361,6 +361,17 @@ void ResetPlayerBaseNodes (edict_t *ent) // FIXME: Turn hands back on too? But two pairs, which one? Shouldn't playerExport->PlayerUpdateModelAttributes do that? + /* Sync mesh list */ + ent->rrs.mesh = 0; + + for (int i = 0; i < MAX_FM_MESH_NODES; i++) + { + if (ent->s.fmnodeinfo[i].flags & FMNI_NO_DRAW) + { + ent->rrs.mesh |= (1 << i); + } + } + SetupPlayerinfo_effects(ent); playerExport->PlayerUpdateModelAttributes(&ent->client->playerinfo); WritePlayerinfo_effects(ent); @@ -410,6 +421,7 @@ qboolean canthrownode_player (edict_t *self, int BP, int *throw_nodes) { *throw_nodes |= Bit_for_MeshNode_player[BP]; self->s.fmnodeinfo[BP].flags |= FMNI_NO_DRAW; + self->rrs.mesh |= (1 << BP); return true; } return false; @@ -448,6 +460,7 @@ void player_dropweapon (edict_t *self, int damage, int whichweaps) self->s.fmnodeinfo[MESH__STAFACTV].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__RHANDHI].flags &= ~FMNI_NO_DRAW; } + if(whichweaps & BIT_HELSTF && !(self->s.fmnodeinfo[MESH__HELSTF].flags & FMNI_NO_DRAW)) { // self->client->playerinfo.helltype = 0; @@ -456,6 +469,7 @@ void player_dropweapon (edict_t *self, int damage, int whichweaps) self->s.fmnodeinfo[MESH__STAFACTV].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__RHANDHI].flags &= ~FMNI_NO_DRAW; } + if(whichweaps & BIT_BOWACTV && !(self->s.fmnodeinfo[MESH__BOWACTV].flags & FMNI_NO_DRAW)) { // self->client->playerinfo.bowtype = 0; @@ -464,6 +478,17 @@ void player_dropweapon (edict_t *self, int damage, int whichweaps) self->s.fmnodeinfo[MESH__BOWACTV].flags |= FMNI_NO_DRAW; self->s.fmnodeinfo[MESH__LHANDHI].flags &= ~FMNI_NO_DRAW; } + + /* Sync mesh list */ + self->rrs.mesh = 0; + + for (int i = 0; i < MAX_FM_MESH_NODES; i++) + { + if (self->s.fmnodeinfo[i].flags & FMNI_NO_DRAW) + { + self->rrs.mesh |= (1 << i); + } + } } void player_dismember (edict_t *self, edict_t *other, int damage, int HitLocation) diff --git a/src/game/player/view.c b/src/game/player/view.c index 40a9a2af0..0d579d575 100644 --- a/src/game/player/view.c +++ b/src/game/player/view.c @@ -313,10 +313,15 @@ void WritePlayerinfo(edict_t *ent) ent->s.renderfx = ent->client->playerinfo.renderfx; ent->s.skinnum = ent->client->playerinfo.skinnum; ent->s.clientnum = ent->client->playerinfo.clientnum; + ent->rrs.mesh = 0; for(i = 0; i < MAX_FM_MESH_NODES;i++) { ent->s.fmnodeinfo[i] = ent->client->playerinfo.fmnodeinfo[i]; + if (ent->client->playerinfo.fmnodeinfo[i].flags & FMNI_NO_DRAW) + { + ent->rrs.mesh |= (1 << i); + } } // From pmove_state_t. @@ -364,10 +369,15 @@ void WritePlayerinfo_effects(edict_t *ent) ent->s.renderfx = ent->client->playerinfo.renderfx; ent->s.skinnum = ent->client->playerinfo.skinnum; ent->s.clientnum = ent->client->playerinfo.clientnum; + ent->rrs.mesh = 0; for(i = 0; i < MAX_FM_MESH_NODES; i++) { ent->s.fmnodeinfo[i] = ent->client->playerinfo.fmnodeinfo[i]; + if (ent->s.fmnodeinfo[i].flags & FMNI_NO_DRAW) + { + ent->rrs.mesh |= (1 << i); + } } } diff --git a/src/game/spell/morph.c b/src/game/spell/morph.c index 9c7634e32..833715aae 100644 --- a/src/game/spell/morph.c +++ b/src/game/spell/morph.c @@ -351,7 +351,9 @@ void Perform_Morph(edict_t *self) self->physicsFlags |= PF_RESIZE; for (i=0;iclient->playerinfo.fmnodeinfo[i].flags &= ~FMNI_NO_DRAW; + } // reset our animation playerExport->PlayerAnimSetLowerSeq(&self->client->playerinfo, ASEQ_STAND);