ModernUO/Projects/UOContent/Engines
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
..
Advanced Search chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
BuffIcons feat: Standardizes South/East selection gumps (#1839) 2025-02-14 00:15:14 -08:00
Bulk Orders chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
CannedEvil chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Character Creation chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Chat fix: Fixes thread guard and cleans up incoming packet reader (#1641) 2023-12-19 17:04:09 -08:00
ConPVP chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Craft chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Doom chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Ethics fix: Fixes ethics causing crashes when not used (#1972) 2024-10-15 17:02:11 -07:00
Events fix: Streamlines event scheduler API. Adds months to weekly recurrence (#2178) 2025-05-07 22:42:44 -07:00
Factions chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Harvest chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Help feat: Adds size/style support to gump builders, optimizes EscapeHtml (#2257) 2025-11-23 11:35:31 -08:00
Khaldun fix: Adds missing string interpolation handler for SetStringSlot (#2123) 2025-02-13 19:30:47 -08:00
ML Quests chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Party chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Pathing feat: Refactors A* Movement to use PriorityQueue (#2244) 2025-07-26 15:53:06 -07:00
Plants chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Player Murder System chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Quests chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Spawners feat: Add CanSpawnMobile overload with props Z-range support. (#2293) 2025-12-27 17:01:15 -08:00
Stealables fix: Consolidates Color/Center html (#1762) 2024-05-07 23:56:32 -07:00
Treasures of Tokuno fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
UltimaStore fix: Fixes thread guard and cleans up incoming packet reader (#1641) 2023-12-19 17:04:09 -08:00
Veteran Rewards chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Virtues chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00