// delete a portal instance by pointer public void DestroyPortal( Portal p ) { // remove the portal from it's target portal Portal targetPortal = p.getTargetPortal(); if ( null != targetPortal ) { targetPortal.setTargetPortal( null ); // the targetPortal will still have targetZone value, but targetPortal will be invalid } // remove the Portal from it's home zone PCZone homeZone = p.getCurrentHomeZone(); if ( null != homeZone ) { // inform zone of portal change. Do here since PCZone is abstract homeZone.PortalsUpdated = true; homeZone.RemovePortal( p ); } // remove the portal from the master portal list this.portals.Remove( p ); }