Commit Graph
3372 Commits
Author SHA1 Message Date
luis 996d980539 Housing: Fix room overlap — compute position from door offsets
Grid spacing was fixed at 15 yards but Square Room (Small) is 24 yards
wide (walls at ±12). Rooms now compute exact yard offsets from connecting
door positions: newCenter = sourceCenter + sourceDoorOffset - newDoorOffset.

Entry(door+3) → Room1(door-12): spacing = 15 yards (matches sniff)
Room1(door+12) → Room1(door-12): spacing = 24 yards (no overlap)

GridX/GridY now store yard offsets (not grid cell indices). Updated DB
migration, LoadFromDB backward compat, and player teleport positions.
2026-04-08 08:40:08 -03:00
luis 512b847ee9 Housing: In-place door connection update after room add
Instead of despawning/recreating all HousingRoomEntities (which crashes
due to same-GUID DESTROY+CREATE), update the adjacent room's door
AttachedRoomGUID via UpdateDoorConnection() which modifies the existing
entity's update field and sends an UPDATE_OBJECT delta. This lets the
client's CanRemove() immediately see the correct connection count.
2026-04-08 08:37:34 -03:00
luis 6590389eca Housing: Fix room add crash — don't despawn all HousingRoomEntities
Despawning and recreating all HousingRoomEntities caused same-GUID
DESTROY+CREATE in one packet batch (NULL+0x08 crash). Now only the
new room's entities are spawned incrementally. Existing rooms' door
connections aren't updated live but are correct after relog.
2026-04-08 08:35:39 -03:00
luis bd25ecebdb Housing: Fix LoadFromDB field indices after gridX/gridY column addition
DoorTypeId/DoorSlot/CeilingTypeId/CeilingSlot were reading from wrong
field indices (8-11 instead of 10-13) after gridX/gridY shifted columns
by 2. Fields 8,9 were also used twice (WallpaperId AND DoorTypeId).
SaveToDB then persisted the corrupt data, overwriting DB fixes.
2026-04-08 08:34:47 -03:00
luis 772ef46f1c Housing: Add SQL migration for gridX/gridY columns
Testers need to run sql/housing/characters_housing_grid_migration.sql
on their characters database. Adds gridX/gridY columns and migrates
existing rooms from linear SlotIndex to 2D grid (gridX=slotIndex).
2026-04-08 08:33:19 -03:00
luis 2834428547 Housing: Persist GridX/GridY to database + full 2D grid support
Added gridX/gridY columns to character_housing_rooms. Room positions
are now persisted as 2D grid coordinates. LoadFromDB reads grid coords
from DB. SaveToDB/PersistRoomToDB writes them. Door adjacency uses all
4 directions (+X/-X/+Y/-Y). Migrated existing data: gridX=slotIndex.

Also: refresh ALL HousingRoomEntities after room add (updates door
connections on adjacent rooms so CanRemove works correctly).
2026-04-08 08:31:58 -03:00
luis a82fd592ca Housing: Fix Entry overlapping Room — set GridX from SlotIndex on DB load
Rooms loaded from DB had GridX=0,GridY=0 (default) because grid coords
aren't persisted yet. Both Entry (slot 0) and Room 1 (slot 1) ended up
at the same world position. Fix: GridX=SlotIndex for backward compat.
2026-04-08 08:29:07 -03:00
luis 6cc5978752 Housing: Refresh all room entities after adding a room
After adding a room, adjacent rooms' HousingRoomEntity door connections
were stale — the old room's AttachedRoomGUID wasn't updated to reference
the new neighbor. The client's CanRemove() saw stale data and blocked
removal ("more than one connected door"). Fix: despawn ALL
HousingRoomEntities and recreate them with fresh door connection data.
MeshObjects are untouched (only room entities refresh).
2026-04-08 08:28:23 -03:00
luis eeadeab434 Housing: 2D grid room placement based on door attachment point
Rooms now use GridX/GridY coordinates instead of linear SlotIndex for
positioning. When a player clicks a door pin to attach a room, the
TargetDoorComponentID identifies the source door. The server finds
the door's offset direction (+X/-X/+Y/-Y) and places the new room
at the adjacent grid cell.

Entry room at (0,0), visual room at (1,0). New rooms placed based on
which door was clicked. Door adjacency checks also use 2D grid for
resolving AttachedRoomGUID connections.
2026-04-08 08:27:21 -03:00
luis 4a7318257f Housing: Spawn interior exit door GO in Entry room
Sniff-verified: retail spawns a door GameObject (type 10 TRANSPORT) in the
Entry room for exiting back to the neighborhood. Alliance uses entry 575017,
Horde 587318 — neither exists in our GO template DB. Using entry 586576
(generic "Front Door", type 10, displayId 116973) at sniff-verified position
(-1002.52, -1000, 0.12) in the Entry room. Spawned in the deferred callback
after AT creation, matching retail packet ordering.
2026-04-08 08:22:18 -03:00
luis 05c372e11d Housing: Multi-MeshObject per component + doorway support
Alliance sniff shows corner walls spawn TWO MeshObjects (SubType=0 +
SubType=1 visual layers) and doorway comp 26 spawns TWO MeshObjects
(DoorwayWall Field_20=1 + Doorway Field_20=2).

Changes:
- FindAllRoomComponentOptions() returns all options per (MSFID, theme)
- Component loop spawns multiple MeshObjects per option entry
- Doorway-capable walls with connected rooms use Type=1+2 options
  (DoorwayWall frame + Doorway opening) instead of Type=0 (solid wall)
- Unconnected door walls use Type=0 (Cosmetic, solid wall)
- Field_20 now passed as parameter to InitHousingRoomComponentData
  (0=Cosmetic, 1=DoorwayWall, 2=Doorway — sniff-verified)
2026-04-08 08:20:56 -03:00
luis 92869cb277 Housing: Fix inside-out walls — negate Z rotation from DB2 OffsetRot
Alliance sniff shows the Z rotation quaternion is OPPOSITE to what the
DB2 OffsetRot value suggests. DB2 comp 27 has RotZ=+90° but the sniff
entity has quat Z=-0.7071 (=-90°). Similarly comp 28: DB2 RotZ=-90°
but sniff quat Z=+0.7071 (=+90°). The left and right walls were
rendering inside-out (showing their back/wooden panel side).
2026-04-08 08:12:47 -03:00
luis 9098eb2d03 DB/TheDreamrift: Added init. spawns 2026-04-07 21:09:59 -03:00
Traesh cf5b9d0ab1 Merge branch 'main' of https://github.com/Thordekk/WowCommunityProject 2026-04-08 01:15:50 +02:00
Traesh 3399d8911b Implement PhaseFlags "ObjectsVisible "
Objects in this phase should be visible from others phases but should be interactible
2026-04-08 01:15:22 +02:00
luis d88939f361 add diagnostic 2026-04-07 20:13:06 -03:00
luis 427d59877f re order 2026-04-07 19:52:46 -03:00
luis 64670d23bb ++ 2026-04-07 19:49:01 -03:00
luis b9f4dc5822 remove wrong includes 2026-04-07 19:45:54 -03:00
luis d09b1e8bc3 rework 2026-04-07 19:43:07 -03:00
luis 8f1c3dbcec remove bad packet 2026-04-07 14:09:37 -03:00
luis 860ade77ef remove wrong handlers 2026-04-07 13:54:20 -03:00
luis 8296f73fd8 remove bad opcodes 2026-04-07 13:47:32 -03:00
luis 55a30d7088 Housing: Revert wall theme to faction default — Alliance uses theme 1 (Folk) 2026-04-07 13:30:14 -03:00
Céfiro_Caecias 80e2009e90 DB/World: Addon Fixes 2026-04-07 11:25:22 -03:00
Céfiro_Caecias e5762f0cb6 DB/World: TC Updates Part 11 2026-04-07 10:46:20 -03:00
Céfiro_Caecias 3075f7e82c DB/World: TC Updates Part 10 2026-04-07 10:22:31 -03:00
luis 4a6ef0aaa8 db error fix 2026-04-07 08:55:34 -03:00
luis 1463780edf Housing: Fix wall models — use Rugged (base theme 2) for ALL walls
Sniff-verified: ALL interior walls use base theme 2 (Rugged, sub-theme 8)
regardless of faction. The Rugged WMO models are the neutral interior
walls designed to match DB2 rotation values. Folk (theme 1) wall models
have different geometry/facing — they show their back side (wooden panels)
when placed with the standard DB2 OffsetRot values.

Floors/ceilings continue to use the faction theme (Folk=1 for Alliance).
2026-04-07 08:47:09 -03:00
luis d5079655d7 Housing: Fix wall models — prefer Type=0 (Cosmetic) room component options
Multiple RoomComponentOption entries exist per (MSFID, theme) with
different Types: 0=Cosmetic (normal wall), 1=DoorwayWall (sealed frame),
2=Doorway (open passage). Our index stored the first match by ID which
was Type=1 (DoorwayWall) — wrong model with doorway cutouts.

Sniff-verified: retail uses Type=0 (Cosmetic) for regular walls.
Type=1/2 are only for doorway-capable walls based on connection state.
Now the index prefers Type=0 entries as the default wall model.
2026-04-07 08:20:49 -03:00
luis 1744ff799b Housing: Fix entity ordering — add TYPEID_HOUSING_ENTITY to visibility switch
Player::UpdateVisibilityOf(IteratorPair) had no case for TYPEID_HOUSING_ENTITY
in its switch statement. HousingRoomEntities were silently skipped during
UpdateObjectVisibilityOnCreate (called by AddToMap). Only MeshObjects were
sent via this path — room entities were deferred to the VisibleNotifier
which runs LATER. Result: MeshObjects arrived before their parent room
entities, causing NULL+0x20 when resolving RoomGUID.

With the switch case added, HousingRoomEntity AddToMap (Phase 1) triggers
an immediate CREATE to the player, before MeshObject AddToMap (Phase 3).
2026-04-07 08:19:03 -03:00
luis c7e0de9b89 Housing: Fix 0x20 crash — missing UpdateVisibilityOf template for HousingRoomEntity
The VisibleNotifier calls UpdateVisibilityOf<HousingRoomEntity> during
the grid scan, but the template was never instantiated. Without the
explicit instantiation, HousingRoomEntity CREATEs were not included in
the initial UPDATE_OBJECT packet. MeshObject components arrived first
with FHousingRoomComponentMesh_C.RoomGUID pointing to room entities
that the client hadn't received yet → NULL resolution → crash at 0x20.

The grid TypeListContainer order (HousingRoomEntity before MeshObject)
was correct all along — the missing template was silently dropping room
entities from the packet.

Also: sub-theme mapping (base theme 1/2 → entity sub-theme 6/8),
UpdateType=1 for MeshObjects, and MeshObject BuildCreate hex dump.
2026-04-07 08:18:02 -03:00
luis 71645968ef Housing: Fix 0x20 crash — base theme vs sub-theme in entity field
RoomComponentOption.Theme is the BASE theme (1=Folk, 2=Rugged) used for
DB2 lookups. FHousingRoomComponentMesh_C.HouseThemeID is the APPLIED
SUB-THEME (6=Folk Medium, 8=Rugged Medium). We were writing the base
theme to the entity field where the client expects the sub-theme.

Sniff-verified: option 267 has DB2 Theme=2 (Rugged base), but the
entity field shows HouseThemeID=8 (Rugged Medium sub-theme). New houses
default to "Medium" sub-theme: Folk(1)→Folk Medium(6), Rugged(2)→
Rugged Medium(8).

Added GetDefaultSubThemeID() to map base→sub-theme. Also reverted all
debug changes (Empty parent, skipped InitHousingRoomComponentData).
2026-04-07 08:14:39 -03:00
luis 1222ab83db Housing: Fix interior crash — grid type order sends MeshObject before parent
The grid TypeListContainer iterates types in order: ..., MeshObject,
HousingRoomEntity. Component MeshObjects (type MeshObject) were sent
in UPDATE_OBJECT BEFORE HousingRoomEntity. The client resolves
AttachParentGUID (Housing/2) during CREATE — parent not yet created
→ NULL → crash at 0x20.

Fix: swap HousingRoomEntity before MeshObject in the type list so
room entities are always sent first in the initial UPDATE_OBJECT.
2026-04-07 08:08:36 -03:00
luis a5fe5daa72 66838 2026-04-07 08:06:18 -03:00
luis e4fe725379 Core/Auras: Split SpellModifierByClassMask into separate flat/pct types 2026-04-06 23:39:46 -03:00
Céfiro_Caecias f453ba2364 Update README.md 2026-04-06 22:03:23 -03:00
luis bbe57b7bd4 ++ 2026-04-06 21:54:04 -03:00
luis 4c249d5ef2 add comment 2026-04-06 21:49:05 -03:00
Shauren 8e192028ed Core/Network: Fix build with msvc versions < 19.43 (vs 2022 17.13)
Signed-off-by: luis <[email protected]>
2026-04-06 19:22:05 -03:00
luis a85b0e968e add room data 2026-04-06 19:21:12 -03:00
luis 084c71d065 typo 2026-04-06 19:19:33 -03:00
Céfiro_Caecias 534860c02f DB/World: TC Updates Part 9 2026-04-06 16:40:04 -03:00
luis b09b8f5d37 Housing: Fix 0x20 crash root cause — Stationary flag on MeshObjects
Retail MeshObjects have HasMeshObject=true, Stationary=false. Our
MeshObject constructor had BOTH Stationary=true AND MeshObject=true.
The extra Stationary block (16 bytes: X,Y,Z,O) shifted all subsequent
parsing of the MeshObject block and fragment data, corrupting the
client's entity data and causing NULL+0x20 crashes.

Sniff-verified: retail interior components have Stationary=false and
HasMeshObject=true. Also restored IsRoom=true on components (sniff
confirms ALL retail room components have IsRoom=true).
2026-04-06 13:40:53 -03:00
luis 06af862469 Housing: Complete room_component_option DB2 data + fix lookup linkage
Replaced 17 synthetic entries with all 587 retail entries from wago.tools.
Fixed the fundamental DB2 linkage: RoomComponentOption links to RoomComponent
via MeshStyleFilterID (not RoomComponentID as we assumed). This means one
option entry covers all components sharing the same MeshStyleFilterID.

Also fixed Alliance default theme from 6 (Folk Medium sub-theme, 0 options)
to 1 (Folk base theme, full option coverage). Fallback chain now uses
Generic(3) and Folk(1) instead of non-existent themes 8/6.

5 base themes now work: Folk(1), Rugged(2), Generic(3), Bel'ameth(4),
Silvermoon(5). Sub-themes (6-28) are texture/dye variants only.
2026-04-06 13:37:01 -03:00
Céfiro_Caecias e3a4d69f93 DB/World: TC Updates Part 8 2026-04-06 13:18:14 -03:00
Céfiro_Caecias 30c34b0829 DB/World: TC Updates Part 7 2026-04-06 10:46:56 -03:00
Céfiro_Caecias 814d133358 DB/World: TC Updates Part 6 2026-04-06 10:45:46 -03:00
Céfiro_Caecias ca04cc399a DB/World: TC Updates Part 5 2026-04-05 19:30:04 -03:00
Céfiro_Caecias c5d8ed345c DB/World: TC Updates Part 4 2026-04-05 18:55:19 -03:00