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) {
10151015 // - The player is inside the buy zone
10161016 // - The player's money has increased AND the weapon entity is destroyed at the same tick (unfortunately the money is updated first)
10171017 var (
1018- owner * common.Player
10191018 oldOwnerMoney int
10201019 lastMoneyUpdateTick int
10211020 lastMoneyIncreased bool
10221021 )
10231022
10241023 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 {
10271026 equipment .Owner = nil
10281027 return
10291028 }
10301029
1031- owner = weaponOwner
10321030 oldOwnerMoney = owner .Money ()
10331031
10341032 owner .Entity .Property ("m_pInGameMoneyServices.m_iAccount" ).OnUpdate (func (val st.PropertyValue ) {
@@ -1040,6 +1038,7 @@ func (p *parser) bindWeaponS2(entity st.Entity) {
10401038 })
10411039
10421040 entity .OnDestroy (func () {
1041+ owner := p .GameState ().Participants ().FindByPawnHandle (entity .PropertyValueMust ("m_hOwnerEntity" ).Handle ())
10431042 if owner != nil && owner .IsInBuyZone () && p .GameState ().IngameTick () == lastMoneyUpdateTick && lastMoneyIncreased {
10441043 p .eventDispatcher .Dispatch (events.ItemRefund {
10451044 Player : owner ,
You can’t perform that action at this time.
0 commit comments