X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fcsqcmodel_hooks.qc;h=227341ae3d4936458a81d1369e89e1fa8e92d492;hb=f33c851ada6cb8957ea5a59ff96171bedd83adbb;hp=dbe999f8600517220936d3e14470ac83d0cb5e5d;hpb=263c592e468eeeffb2755d204b21eb13e398adac;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index dbe999f86..227341ae3 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -10,6 +10,9 @@ #include "../common/animdecide.qh" #include "../common/csqcmodel_settings.qh" #include "../common/teams.qh" +#include "../common/triggers/trigger/viewloc.qh" + +#include "mutators/events.qh" #include "../csqcmodellib/cl_model.qh" #include "../csqcmodellib/cl_player.qh" @@ -400,6 +403,14 @@ void CSQCModel_AutoTagIndex_Apply(void) if(self.tag_entity && wasfreed(self.tag_entity)) self.tag_entity = world; + if(self.viewloc && wasfreed(self.viewloc)) + self.viewloc = world; + + if(self.viewloc.entnum != self.tag_networkviewloc) + self.viewloc = findfloat(world, entnum, self.tag_networkviewloc); + + MUTATOR_CALLHOOK(TagIndex_Update, self); + if(self.tag_networkentity) { // we are ATTACHED! @@ -429,9 +440,9 @@ void CSQCModel_AutoTagIndex_Apply(void) if(self.tag_entity) { // the best part is: IT EXISTS - if(substring(self.model, 0, 17) == "models/weapons/v_") + if(substring(self.model, 0, 14) == "models/weapons") { - if(substring(self.tag_entity.model, 0, 17) == "models/weapons/h_") + if(substring(self.tag_entity.model, 0, 14) == "models/weapons") { self.tag_index = gettagindex(self.tag_entity, "weapon"); if(!self.tag_index) @@ -451,12 +462,14 @@ void CSQCModel_AutoTagIndex_Apply(void) } } - if(substring(self.tag_entity.model, 0, 17) == "models/weapons/v_") + if(substring(self.tag_entity.model, 0, 14) == "models/weapons") { self.tag_index = gettagindex(self.tag_entity, "shot"); if(!self.tag_index) self.tag_index = gettagindex(self.tag_entity, "tag_shot"); } + + MUTATOR_CALLHOOK(TagIndex_Apply, self); } else { @@ -655,10 +668,10 @@ void CSQCModel_Hook_PreDraw(bool isplayer) bool onground = 0; if(self == csqcplayer) { - if(self.pmove_flags & PMF_ONGROUND) + if(self.flags & FL_ONGROUND) onground = 1; - self.anim_prev_pmove_flags = self.pmove_flags; - if(self.pmove_flags & PMF_DUCKED) + self.anim_prev_pmove_flags = self.flags; + if(self.flags & FL_DUCKED) animdecide_setstate(self, self.anim_state | ANIMSTATE_DUCK, false); else if(self.anim_state & ANIMSTATE_DUCK) animdecide_setstate(self, self.anim_state - ANIMSTATE_DUCK, false);