private void OnBuildingExitZone(Zone zone, BaseCombatEntity entity) { HashSet<Zone> zones; if (buildingZones.TryGetValue(entity, out zones)) { zone.OnEntityKill(entity); if (!zones.Remove(zone)) return; if (zones.Count <= 0) buildingZones.Remove(entity); } if (HasZoneFlag(zone, ZoneFlags.NoStability)) { var block = entity as BuildingBlock; if (block == null) return; var prefab = GameManager.server.FindPrefab(block.blockDefinition.fullName); block.grounded = prefab.GetComponent<BuildingBlock>()?.grounded ?? false; } //Puts("OnBuildingExitZone: {0}", entity.GetType()); }
private void OnPlayerExitZone(Zone zone, BasePlayer player) { HashSet<Zone> zones; if (playerZones.TryGetValue(player, out zones)) { zone.OnEntityKill(player); if (!zones.Remove(zone)) return; if (zones.Count <= 0) playerZones.Remove(player); } UpdateFlags(player); if (!string.IsNullOrEmpty(zone.Info.leave_message)) { if (PopupNotifications != null && usePopups) PopupNotifications.Call("CreatePopupNotification", string.Format(zone.Info.leave_message, player.displayName), player); else SendMessage(player, zone.Info.leave_message, player.displayName); } if (zone.KeepInList.Contains(player.userID)) AttractPlayer(zone, player); Interface.Oxide.CallHook("OnExitZone", zone.Info.ID, player); //Puts("OnPlayerExitZone: {0}", player.GetType()); }