Commit graph

889 commits

Author SHA1 Message Date
Kelsi
16d88f19fc Fix instance portals: WDT byte order, box trigger sizing, suppress ping-pong, WMO cache cleanup
- Fix WDT chunk magic constants to big-endian ASCII (matching ADTLoader)
- Add minimum effective size for box area triggers (90 units, like sphere 45-unit radius)
- Add areaTriggerSuppressFirst_ flag to prevent portal ping-pong on map transfer
- Add WMORenderer::clearAll() to clear models/textures on map change (prevents GPU crash)
- Increase WMO texture cache default to 8GB
- Fix setMapName called after loadTestTerrain so WMO renderer exists
- Save/restore player position around CMSG_AREATRIGGER to prevent bad DB persistence
2026-02-27 04:59:12 -08:00
Kelsi
d0e8b44866 Add instance support: WDT parser, WMO-only map loading, area triggers, BG queue accept
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
- WDT parser detects WMO-only maps (dungeons/raids/BGs) via MPHD flag 0x01
- WMO-only loading branch in loadOnlineWorldTerrain loads root WMO directly
- Area trigger system: loads AreaTrigger.dbc, checks player proximity, sends CMSG_AREATRIGGER
- BG queue acceptance via /join command sending CMSG_BATTLEFIELD_PORT
- SMSG_INSTANCE_DIFFICULTY handler stub
- Map change cleanup (clear old WMO/M2/terrain on map transfer)
- 5-second area trigger cooldown after map transfer to prevent ping-pong loops
2026-02-26 17:56:11 -08:00
Kelsi
a559d5944b Fix shutdown hangs, bank bag icons/drag-drop, loading screen progress, and login spawn
- Fix shutdown hang: skip vmaDestroyAllocator (walked thousands of allocations),
  replace unsafe pthread_timedjoin_np with plain join + early-exit checks in workers
- Bank window: full icon rendering, click-and-hold pickup (0.10s), drag-drop for
  all bank slots including bank bag equip slots, same-slot drop detection
- Loading screen: process one tile per frame for live progress updates
- Camera reset: trust server position in online mode to avoid spawning under WMOs
- Fix PLAYER_BYTES/PLAYER_BYTES_2 field indices, preserve purchasedBankBagSlots
  across inventory rebuilds, fix bank slot purchase result codes
2026-02-26 13:38:29 -08:00
Kelsi
804b947203 Fix bank for all expansions: add missing field indices and per-expansion slot counts
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
2026-02-26 11:12:34 -08:00
Kelsi
66bcb0a712 Fix map exploration by checking subzone bits instead of only the parent zone bit 2026-02-26 11:01:52 -08:00
Kelsi
5d92152701 Fix bank items not appearing by deferring inventory rebuild after item creation 2026-02-26 10:46:47 -08:00
Kelsi
74b78cd10b Add pet tracking via SMSG_PET_SPELLS and dismiss pet button 2026-02-26 10:41:29 -08:00
Kelsi
a1f73fdd39 Handle SMSG_PARTY_MEMBER_STATS to show group health out of visual range
Parse SMSG_PARTY_MEMBER_STATS and SMSG_PARTY_MEMBER_STATS_FULL packets
so party frames display health, power, level, and online status even
when group members are not nearby. Expansion-aware field sizes: uint16
health for Classic/TBC, uint32 for WotLK, plus per-expansion aura and
vehicle seat handling.
2026-02-26 10:25:55 -08:00
Kelsi
1cf485d149 Increase terrain load radius during taxi flights to fix missing tiles
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Load radius was reduced to 3 during taxi (from 4 normal), causing
tiles to not load fast enough at 32 u/s flight speed. Increased to 6
and restored update interval to 0.033s for responsive tile detection.
2026-02-26 03:06:17 -08:00
Kelsi
1c07e87b7e Add missing movement ACK responses to avoid server stalls
Implement generic handlers for force speed changes (walk, run back,
swim, swim back, flight, flight back, turn rate, pitch rate),
movement flag toggles (CAN_FLY, HOVER, feather fall, water walk),
and knockback ACKs. Fix SMSG_TIME_SYNC_REQ to respond with
CMSG_TIME_SYNC_RESP instead of silently dropping.
2026-02-26 03:02:51 -08:00
Kelsi
923260c90c Fix reversed strafe directions while swimming
Water strafe used opposite sign convention from land movement.
Land: strafeLeft += right, strafeRight -= right.
Water was: strafeLeft -= right, strafeRight += right.
Now matches land.
2026-02-26 02:37:49 -08:00
Kelsi
3d6e3993d2 Fix water splash sounds bypassing mute via ffplay path
playOneShot() spawns an external ffplay process that bypasses the
miniaudio engine master volume. Now checks getMasterVolume() before
spawning the process.
2026-02-26 02:34:36 -08:00
Kelsi
25412ff5cc Fix DBC loading and bank drag-and-drop reliability
- Force binary loading for SkillLine.dbc (CSV exports are garbled)
- Handle quoted numeric values in DBC CSV parser
- Fix bank slot drag-and-drop to use mouse-release detection instead
  of click detection, preventing item drops on wrong slots
- Fix action bar item drop to use hoveredOnRelease for consistency
2026-02-26 02:33:10 -08:00
Kelsi
5cb469e318 Skip sound playback when master volume is muted
Water splash and swimming sounds were bypassing mute because
ma_engine_set_volume(0) didn't fully prevent sound creation.
Now playSound2D and playSound3D early-return when masterVolume
is zero.
2026-02-26 02:31:06 -08:00
Kelsi
c0c5b75e94 Fill ocean water across entire tile to fix missing harbor water
Coastal areas like Booty Bay had gaps in ocean water where MH2O
data didn't cover harbor chunks (only 34/256 chunks had ocean
entries). For sea-level ocean surfaces (type=2, height~0), the
mask is now initialized to fully visible instead of empty, letting
depth testing against terrain handle land occlusion naturally.
2026-02-26 02:28:26 -08:00
Kelsi
c2b271df6f Fix spellbook tabs race condition with DBC lazy loading
lookupSpellName() (called by action bar tooltips) was triggering
loadSpellDBC() early, setting dbcLoadAttempted=true before the
spellbook opened. This caused loadSkillLineDBCs() to be skipped,
so all spells were categorized into "General". Fixed by checking
each DBC's own loaded flag independently and re-categorizing when
skill line data becomes available.
2026-02-26 01:21:51 -08:00
Kelsi
c919477e74 Fix item use (CMSG_USE_ITEM), mount tab, and inventory right-click
- Fix SMSG_ITEM_QUERY_SINGLE_RESPONSE parsing: read statsCount stat
  pairs instead of always 10, use 2 damage entries (MAX_ITEM_PROTO_DAMAGES),
  and parse item spell data (spellId + spellTrigger per slot)
- Pass item spell ID in CMSG_USE_ITEM packet so server processes item
  use requests (spellId=0 caused silent server rejection)
- Add spellId parameter to buildUseItem interface across all expansions
- Fix spellbook mount tab to use SkillLine 777 (Mounts) instead of 762
  (Riding), so known mount summon spells appear correctly
- Fix inventory right-click: use IsItemHovered+IsMouseClicked instead
  of IsItemClicked for InvisibleButton (which only tracks left-clicks)
- Fix SlotKind enum declaration order in inventory_screen.hpp
2026-02-26 00:59:07 -08:00
Kelsi
7982815a67 Add Companions tab to spellbook for vanity pets (SkillLine 778)
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
- Companion pet spells (SkillLine 778) get their own "Companions" tab
- Mounts (SkillLine 762) and Companions are now split out from secondary
  skills instead of being lumped into profession tabs
- Refactored tab grouping into addGroupedTabs helper to reduce duplication
- Tab order: Specs > General > Professions > Mounts > Companions
- Double-click to summon companions/mounts works via existing castSpell
2026-02-25 15:04:17 -08:00
Kelsi
0d87a86516 Separate spellbook into spec, general, profession, and mount tabs
- Class spec abilities now get individual tabs (e.g. Fire, Frost, Arcane)
- Primary professions each get their own tab (Alchemy, Blacksmithing, etc.)
- Secondary professions get tabs (Cooking, First Aid, Fishing)
- Mounts tab for all spells linked to Riding skill line (762)
- General tab for everything else (racials, weapon skills, etc.)
- Tab order: specs first, then General, then professions, then Mounts
2026-02-25 14:59:09 -08:00
Kelsi
da959cfb8f Revamp talent and spellbook UIs with proper visuals and functionality
Talent screen:
- Remove all debug text and per-frame LOG_INFO spam
- Show class name in window title (e.g. "Warrior Talents")
- Display point distribution in header (0/31/20) and per-tab counts
- Highlighted active spec button with styled spec switcher
- Load and render tree background textures from TalentTab.dbc
- Draw prerequisite arrows with arrowheads (green=met, gray=unmet)
- Fix rank display (was showing rank+1, now correct 1-indexed values)
- Rank counter with dark background pill for readability
- Hover glow effect, rounded corners, centered grid layout
- Wider window (680x600) for 4-column WoW talent grid

Spellbook:
- Add search/filter bar for finding spells by name
- Add spell descriptions from Spell.dbc tooltip field
- Rich tooltips with name, rank, passive indicator, cooldown, description
- Visual icon borders: yellow=passive, red=cooldown, default=active
- Cooldown overlay on icon with countdown number
- Hover highlight on spell rows
- Tab counts update to reflect search filter results
- Rounded corners on icons and hover states
- Extracted renderSpellTooltip helper for consistent tooltip rendering
2026-02-25 14:55:40 -08:00
Kelsi
889cd86fb0 Remove level cap from auction search to allow finding items of any required level 2026-02-25 14:45:53 -08:00
Kelsi
1ae5fe867c Improve auction house UI with search filters, pagination, sell picker, and tooltips
- Add item class/subclass category filters (Weapon, Armor, etc.) with correct WoW 3.3.5a IDs
- Add sell item picker dropdown with icons and Create Auction button
- Add pagination (Prev/Next) for browse results with filter preservation
- Add Buy/Bid action buttons to Bids tab
- Add item icons and stat tooltips on hover across all three tabs
- Add Enter-to-search from name field and search delay countdown
- Parse SMSG_AUCTION_OWNER/BIDDER_NOTIFICATION into chat messages
- Auto-refresh browse results after bid/buyout using saved search params
- Clamp level range inputs to 0-80
2026-02-25 14:44:44 -08:00
Kelsi
9906269671 Add mail item attachment support for sending
- CMSG_SEND_MAIL now includes item GUIDs (up to 12 per WotLK)
- Right-click items in bags to attach when mail compose is open
- Compose window shows 12-slot attachment grid with item icons
- Click attached items to remove them
- Classic/Vanilla falls back to single item GUID format
2026-02-25 14:11:09 -08:00
Kelsi
ce30cedf4a Deposit all items to bank on right-click when bank is open
All right-clicked inventory items now deposit to bank regardless of
whether they are equippable, usable, or materials.
2026-02-25 14:00:54 -08:00
Kelsi
d61b7b385d Only auto-deposit non-equippable items to bank on right-click
Right-clicking equippable items (inventoryType > 0) while the bank is
open now equips them as normal instead of depositing. Only materials,
quest items, and other non-equippable items auto-deposit to bank.
2026-02-25 13:57:37 -08:00
Kelsi
af7fb4242c Add drag-and-drop support for inventory to bank slots
Bank window slots now act as drop targets when holding an item from
inventory. Empty bank slots highlight green, and clicking drops the
held item via CMSG_SWAP_ITEM. Occupied bank slots accept swaps too.
Works for both main bank slots (39-66) and bank bag slots (67+).
2026-02-25 13:54:47 -08:00
Kelsi
2ab5cf5eb6 Add inventory-to-bank deposit on right-click
When the bank is open, right-clicking a backpack or bag item now
deposits it into the bank via CMSG_AUTOBANK_ITEM instead of trying
to equip/use it. Bank deposit takes priority over vendor sell and
auto-equip actions.
2026-02-25 13:47:42 -08:00
Kelsi
e220ce888d Fix window close hang from blocking worker thread joins
unloadAll() now uses a 500ms deadline with pthread_timedjoin_np to
avoid blocking indefinitely when worker threads are mid-prepareTile
(reading MPQ archives / parsing ADT files). Threads that don't finish
within the deadline are detached so the app can exit promptly.
2026-02-25 13:42:58 -08:00
Kelsi
26a685187e Fix /logout hang caused by blocking worker thread joins
unloadAll() joins worker threads which blocks if they're mid-tile
(prepareTile can take seconds for heavy ADTs). Replace with softReset()
which clears tile data, queues, and water surfaces without stopping
worker threads — workers find empty queues and idle naturally.
2026-02-25 13:37:09 -08:00
Kelsi
872b10fe68 Fix water descriptor pool leak and add water rendering diagnostics
- Add VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT to water material
  descriptor pool so individual sets can be freed when tiles are unloaded
- Free descriptor sets in destroyWaterMesh() instead of leaking them
- Add terrain manager unloadAll() during logout to properly clear stale
  tiles, water surfaces, and queues between sessions
- Add diagnostic logging for water surface loading, material allocation
  failures, and render skip reasons to investigate missing water
2026-02-25 13:26:08 -08:00
Kelsi
94e4a0bdb3 Fix letter-named patch MPQs not loading on case-sensitive filesystems
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Two bugs in loadPatchArchives():
1. isLetterPatch detection was inverted (rfind != 0 is false for all
   "patch-*" entries), making the disable flags non-functional
2. Patch file lookup used exact std::filesystem::exists() which is
   case-sensitive on Linux — Patch-A.MPQ wouldn't match patch-a.mpq

Now scans the data directory once and builds a case-insensitive lookup
map, so any case variant (Patch-A.MPQ, patch-a.mpq, PATCH-A.MPQ) is
found correctly.
2026-02-25 12:18:36 -08:00
Kelsi
956e2c8bb1 Reduce city stutter: lower spawn rate, resync interval, M2 render distance
- MAX_SPAWNS_PER_FRAME 8→3 (each spawn does sync M2 load, 5-50ms each)
- Creature resync scan interval 1s→3s (O(N) entity iteration)
- M2 render distance: add 1000+ instance tier at 500 units, reduce 2000+
  tier from 350→300 units to cap draw call count in dense cities
2026-02-25 12:16:55 -08:00
Kelsi
9c25713b72 Disable login screen music 2026-02-25 12:11:19 -08:00
Kelsi
53405ea322 Fix crash on re-login by clearing all per-session state on logout
logoutToLogin() was only clearing a handful of flags, leaving stale
entity instance maps, pending spawn queues, transport state, mount
state, and charge state from the previous session.  On second login,
these stale GUIDs and instance IDs caused invalid renderer operations
and crashes.

Now clears: creature/player/gameObject instance maps, all pending
spawn queues, transport doodad batches, mount/charge state, player
identity, and renderer world geometry (WMO instances, M2 models,
quest markers).  Also disconnects TransportManager from WMORenderer
before teardown to prevent dangling pointer access.
2026-02-25 12:09:00 -08:00
Kelsi
401cb6928c Disable WMO/M2 camera collision raycasts
Camera collision with WMO walls and M2 doodads caused erratic zoom
and pull-through at doorway transitions. Terrain-only camera floor
clamping is retained.
2026-02-25 12:06:24 -08:00
Kelsi
64879b8aab Overhaul WMO collision: precompute normals, fix floor selection, optimize queries
- Precompute triangle normals in buildCollisionGrid, eliminating per-query
  cross+normalize in getFloorHeight, checkWallCollision, and raycastBoundingBoxes
- Fix floor selection: remove redundant allowAbove (callers already elevate
  probeZ by stepUpBudget), preventing upper-story snap at doorway transitions
- Align wall classification threshold (absNz < 0.35) with runtime skip check,
  eliminating ~30% wasted wall triangle fetches
- Replace O(n log n) sort+unique dedup in range queries with O(n) visited bitset
- Rename wallTriScratch to triScratch_, fix stale threshold comments
2026-02-25 11:56:58 -08:00
Kelsi
35384b2c52 Fix Windows ERROR macro collision in logger 2026-02-25 11:14:53 -08:00
Kelsi
c849f9cdfa chore: update camera controller changes 2026-02-25 10:41:54 -08:00
Kelsi
7557e388fb Fix Booty Bay floor fall-through via M2-aware grounding rescue 2026-02-25 10:26:41 -08:00
Kelsi
bdde5f305a Harden WMO grounding rescue to prevent fall-through 2026-02-25 10:24:54 -08:00
Kelsi
2219ccde51 Optimize city performance and harden WMO grounding 2026-02-25 10:22:05 -08:00
Kelsi
52accfde80 Optimize login music scanning and warden debug formatting 2026-02-25 09:50:33 -08:00
Kelsi
c26353eda1 Reduce release log spam and harden release logging defaults 2026-02-25 09:46:27 -08:00
Kelsi
5966fedc59 Use outbound local IP for logon challenge with safe fallback 2026-02-25 09:37:52 -08:00
Kelsi
fc68c6c6b7 Fix Warden module parse fallback and macOS FMOD integrity aliases 2026-02-25 09:26:34 -08:00
Kelsidavis
1fab17e639 Add Windows build scripts, fix multi-threaded MPQ extraction, and cross-platform temp paths
- Add build.ps1/bat, rebuild.ps1/bat, debug_texture.ps1/bat (Windows equivalents
  of existing bash scripts, using directory junctions for Data link)
- Fix asset extractor: StormLib is not thread-safe even with separate handles per
  thread. Serialize all MPQ reads behind a mutex while keeping CRC computation and
  disk writes parallel. Previously caused 99.8% extraction failures with >1 thread.
- Add SFileHasFile() check during enumeration to skip listfile-only entries
- Add diagnostic logging for extraction failures (first 5 per thread + summary)
- Use std::filesystem::temp_directory_path() instead of hardcoded /tmp/ in
  character_renderer.cpp debug dumps
- Update debug_texture.sh to use $TMPDIR fallback and glob for actual dump filenames
2026-02-25 08:22:45 -08:00
Kelsi
570dec8b88 Fix loading screen graphical artifacts on window resize
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Recreate Vulkan swapchain in LoadingScreen::render() when the dirty flag
is set, so resizing the window during world loading no longer renders
into a stale swapchain with mismatched framebuffers.
2026-02-25 03:45:13 -08:00
Kelsi
4c8fa9f1fe Add Windows and macOS CPU affinity support
- Windows: SetThreadAffinityMask to pin main thread to core 0 and
  exclude workers from core 0
- macOS: thread_policy_set with THREAD_AFFINITY_POLICY tags to hint
  scheduler separation (tag 1 for main, tag 2 for workers)
2026-02-25 03:41:18 -08:00
Kelsi
86505ad377 Merge per-chunk water surfaces, restore incremental tile finalization, and pin main thread CPU affinity
Water deduplication: merge per-chunk water surfaces into per-tile surfaces
to reduce Vulkan descriptor set usage from ~8900 to ~100-200. Uses hybrid
approach — groups with ≤4 chunks stay per-chunk (preserving shore detail),
larger groups merge into 128×128 tile-wide surfaces.

Re-add incremental tile finalization state machine (reverted in 9b90ab0)
to spread GPU uploads across frames and prevent city stuttering.

Pin main thread to CPU core 0 and exclude worker threads from core 0
to reduce scheduling jitter on the render/game loop.
2026-02-25 03:39:45 -08:00
Kelsi
7ca9caa212 Fix Windows ARM64 build: disable x86 asm in StormLib's libtomcrypt
StormLib's bundled libtomcrypt uses x86 inline assembly (bswapl/movl)
gated by __MINGW32__, which is defined on CLANGARM64 too. Pass
-DLTC_NO_BSWAP to force portable C byte-swap fallback.
2026-02-25 03:06:06 -08:00