File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1015,20 +1015,18 @@ func (p *parser) bindWeaponS2(entity st.Entity) {
1015
1015
// - The player is inside the buy zone
1016
1016
// - The player's money has increased AND the weapon entity is destroyed at the same tick (unfortunately the money is updated first)
1017
1017
var (
1018
- owner * common.Player
1019
1018
oldOwnerMoney int
1020
1019
lastMoneyUpdateTick int
1021
1020
lastMoneyIncreased bool
1022
1021
)
1023
1022
1024
1023
entity .Property ("m_hOwnerEntity" ).OnUpdate (func (val st.PropertyValue ) {
1025
- weaponOwner := p .GameState ().Participants ().FindByPawnHandle (val .Handle ())
1026
- if weaponOwner == nil {
1024
+ owner := p .GameState ().Participants ().FindByPawnHandle (val .Handle ())
1025
+ if owner == nil {
1027
1026
equipment .Owner = nil
1028
1027
return
1029
1028
}
1030
1029
1031
- owner = weaponOwner
1032
1030
oldOwnerMoney = owner .Money ()
1033
1031
1034
1032
owner .Entity .Property ("m_pInGameMoneyServices.m_iAccount" ).OnUpdate (func (val st.PropertyValue ) {
@@ -1040,6 +1038,7 @@ func (p *parser) bindWeaponS2(entity st.Entity) {
1040
1038
})
1041
1039
1042
1040
entity .OnDestroy (func () {
1041
+ owner := p .GameState ().Participants ().FindByPawnHandle (entity .PropertyValueMust ("m_hOwnerEntity" ).Handle ())
1043
1042
if owner != nil && owner .IsInBuyZone () && p .GameState ().IngameTick () == lastMoneyUpdateTick && lastMoneyIncreased {
1044
1043
p .eventDispatcher .Dispatch (events.ItemRefund {
1045
1044
Player : owner ,
You can’t perform that action at this time.
0 commit comments