ModernUO/Projects/UOContent
Kamron Batman 6d51b33cf8
feat: Add CanSpawnMobile overload with props Z-range support. (#2293)
### Summary

- Adds CanSpawnMobile(x, y, minZ, maxZ, canSwim, cantWalk, out spawnZ) overload for finding spawn surfaces within a Z range
- Adds CanSpawnItem(x, y, minZ, maxZ, out spawnZ) for item spawning with Surface+Impassable support (tables, furniture)
- Uses bitmask optimization inspired by Item.DropToWorld's m_OpenSlots pattern for O(1) surface/blocker checks
- HomeRange spawners now use surface detection to set proper Z bounds

### Key Changes

Map.cs:
- CanSpawnMobile with Z-range finds lowest valid surface for mobiles
- CanSpawnItem with Z-range finds lowest valid surface for items (including tables)
- CanFitItem for point-check item placement on Surface+Impassable tiles
- Bitmask approach eliminates nested loops and stackalloc arrays

Spawners:
- Simplified GetSpawnPosition using new Z-range methods
- HomeRange setter detects surface below spawner for proper Z bounds
- Consistent handling for mobiles and items

### Bug Fixes

- Water tiles (Impassable | Wet) no longer block swimming mobs
- Items can now spawn on tables/furniture (Surface+Impassable)

### Test Plan

- Run dotnet test - 631 tests pass
- Manual testing: multi-story spawning, water mobs, item spawning on tables
- Verify HomeRange spawner movement shifts bounds correctly
2025-12-27 17:01:15 -08:00
..
Accounting chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Assistants chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Commands chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Compression chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Configuration chore: Updates copyright (#1448) 2023-08-09 09:09:26 -07:00
Console feat: Adds console commands (#1714) 2024-03-30 09:40:43 -07:00
Context Menus fix: Moves ContextMenu out of core, streamlines code, fixes bugs (#1873) 2024-07-20 21:33:23 -07:00
Engines feat: Add CanSpawnMobile overload with props Z-range support. (#2293) 2025-12-27 17:01:15 -08:00
Gumps chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Holiday Stuff chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Items chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Migrations feat: Changes Spawner HomeRange to SpawnBounds (#2290) 2025-12-26 18:07:26 -08:00
Misc chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Mobiles feat: Add CanSpawnMobile overload with props Z-range support. (#2293) 2025-12-27 17:01:15 -08:00
Multis chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Network chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Regions feat: New Jail System (#2215) 2025-07-16 20:41:21 -07:00
Skills chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Special Systems feat: Converts OnLogin to a coded generated event (#2070) 2025-01-17 15:21:45 -08:00
Spells chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Systems/JailSystem feat: Adds size/style support to gump builders, optimizes EscapeHtml (#2257) 2025-11-23 11:35:31 -08:00
Targets chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Text feat: Adds size/style support to gump builders, optimizes EscapeHtml (#2257) 2025-11-23 11:35:31 -08:00
Utilities chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
World Saves chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Module.cs fix: Fixes sending packets and sidesteps a major issue with stackalloc and PGO in .NET 8 (#1607) 2023-11-21 12:18:20 -08:00
UOContent.csproj feat: Bumps Serialization Generator for better support (#2292) 2025-12-26 14:27:24 -08:00