@@ -944,6 +944,16 @@ func (p *parser) bindGrenadeProjectiles(entity st.Entity) {
944
944
})
945
945
}
946
946
947
+ newPos := proj .Position ()
948
+
949
+ proj .Trajectory = append (proj .Trajectory , newPos )
950
+
951
+ proj .Trajectory2 = append (proj .Trajectory2 , common.TrajectoryEntry {
952
+ Position : newPos ,
953
+ FrameID : p .CurrentFrame (),
954
+ Time : p .CurrentTime (),
955
+ })
956
+
947
957
if p .isSource2 () && ! p .disableMimicSource1GameEvents {
948
958
p .eventDispatcher .Dispatch (events.WeaponFire {
949
959
Shooter : proj .Owner ,
@@ -957,6 +967,16 @@ func (p *parser) bindGrenadeProjectiles(entity st.Entity) {
957
967
})
958
968
959
969
entity .OnDestroy (func () {
970
+ newPos := proj .Position ()
971
+
972
+ proj .Trajectory = append (proj .Trajectory , newPos )
973
+
974
+ proj .Trajectory2 = append (proj .Trajectory2 , common.TrajectoryEntry {
975
+ Position : newPos ,
976
+ FrameID : p .CurrentFrame (),
977
+ Time : p .CurrentTime (),
978
+ })
979
+
960
980
if p .demoInfoProvider .IsSource2 () && wep == common .EqFlash && ! p .disableMimicSource1GameEvents {
961
981
p .gameEventHandler .dispatch (events.FlashExplode {
962
982
GrenadeEvent : events.GrenadeEvent {
@@ -1010,16 +1030,6 @@ func (p *parser) bindGrenadeProjectiles(entity st.Entity) {
1010
1030
}
1011
1031
})
1012
1032
1013
- entity .OnPositionUpdate (func (newPos r3.Vector ) {
1014
- proj .Trajectory = append (proj .Trajectory , newPos )
1015
-
1016
- proj .Trajectory2 = append (proj .Trajectory2 , common.TrajectoryEntry {
1017
- Position : newPos ,
1018
- FrameID : p .CurrentFrame (),
1019
- Time : p .CurrentTime (),
1020
- })
1021
- })
1022
-
1023
1033
// Some demos don't have this property as it seems
1024
1034
// So we need to check for nil and can't send out bounce events if it's missing
1025
1035
if bounceProp := entity .Property ("m_nBounces" ); bounceProp != nil {
@@ -1035,6 +1045,16 @@ func (p *parser) bindGrenadeProjectiles(entity st.Entity) {
1035
1045
BounceNr : bounceNumber ,
1036
1046
})
1037
1047
}
1048
+
1049
+ newPos := proj .Position ()
1050
+
1051
+ proj .Trajectory = append (proj .Trajectory , newPos )
1052
+
1053
+ proj .Trajectory2 = append (proj .Trajectory2 , common.TrajectoryEntry {
1054
+ Position : newPos ,
1055
+ FrameID : p .CurrentFrame (),
1056
+ Time : p .CurrentTime (),
1057
+ })
1038
1058
})
1039
1059
}
1040
1060
}
0 commit comments