File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1748,8 +1748,9 @@ public void Client_onEntityLeaveWorld(Int32 eid)
17481748 }
17491749 else
17501750 {
1751- _controlledEntities . Remove ( entity ) ;
1752- Event . fireOut ( "onLoseControlledEntity" , new object [ ] { entity } ) ;
1751+ if ( _controlledEntities . Remove ( entity ) )
1752+ Event . fireOut ( "onLoseControlledEntity" , new object [ ] { entity } ) ;
1753+
17531754 entities . Remove ( eid ) ;
17541755 entity . onDestroy ( ) ;
17551756 _entityIDAliasIDList . Remove ( eid ) ;
@@ -2074,8 +2075,8 @@ public void Client_onEntityDestroyed(Int32 eid)
20742075 entity . leaveWorld ( ) ;
20752076 }
20762077
2077- _controlledEntities . Remove ( entity ) ;
2078- Event . fireOut ( "onLoseControlledEntity" , new object [ ] { entity } ) ;
2078+ if ( _controlledEntities . Remove ( entity ) )
2079+ Event . fireOut ( "onLoseControlledEntity" , new object [ ] { entity } ) ;
20792080
20802081 entities . Remove ( eid ) ;
20812082 entity . onDestroy ( ) ;
You can’t perform that action at this time.
0 commit comments