4410 Commits
Author SHA1 Message Date
luis 776d9b64f6 FIX BUILD 2026-04-10 08:39:54 -03:00
luis 4cefdb9548 5 errors left 2026-04-10 08:29:28 -03:00
luis ab0601b9fc comment mesh object 2026-04-10 08:25:27 -03:00
luis e3ca033ce7 ++ 2026-04-10 08:24:00 -03:00
luis d12c865fc1 build fix part 1 2026-04-10 08:06:17 -03:00
luis 41a96222e6 remove complete 2026-04-10 08:03:08 -03:00
luis 50d420f6d4 remove bad changes 2026-04-09 21:35:11 -03:00
luis b1ad20e74a sure here crash 2026-04-09 21:34:28 -03:00
luis 91645e61f1 disable entire housing but we still have crash i need help guys 2026-04-09 21:31:44 -03:00
luis b1e47f3b41 pull request approved 2026-04-09 21:31:44 -03:00
Traesh 8aca4a618e Merge branch 'main' of https://github.com/Thordekk/WowCommunityProject 2026-04-10 00:19:32 +02:00
luis 0e07d0eaa1 Housing: Fix floor material + stairwell doorway + decor accessors
1. Floor material: APPLY_COMPONENT_MATERIALS now directly updates the
   specific component MeshObject's textureID instead of going through
   room-level WallpaperId (which was overwritten/reset on each change).

2. Stairwell doorway: Reverted HasStairs check — stairwell rooms connect
   horizontally through walls like any room. The doorway should open.

3. Added GetRoomComponentOptionID/GetHouseThemeID accessors to MeshObject
   for per-component texture updates without room-level state.
2026-04-09 08:01:51 -03:00
luis a1350b340a Housing: Fix stairwell placement — same floor, adjacent position
Stairwell rooms are tall rooms (geobox Z=-1 to 14) placed ADJACENT to
the source room on the SAME floor, not above it. They extend vertically
through the ceiling. Only rooms connected at the stairwell's ceiling
door should go to floor+1. Was incorrectly using FloorIndex+1.
2026-04-09 07:59:17 -03:00
luis 7357fb7fca Housing: Fix decor not selectable after relog — remove double CREATE send
Interior decor was sent TWICE at login: once by the map visibility system
(AddToMap → UpdateObjectVisibilityOnCreate) and again by the deferred
callback (manual BuildCreateUpdateBlockForPlayer). The double CREATE
corrupted the client's entity state, making decor unselectable.

Session-placed decor only got one CREATE (via AddToMap) and worked fine.

Fix: removed the manual decor CREATE from the deferred callback. The
visibility system already handles decor delivery to the player.
2026-04-09 07:57:47 -03:00
luis 14ddebca90 Housing: Fix wall material changing floor + stairwell wall destruction
1. APPLY_COMPONENT_MATERIALS handler now passes componentIDs filter to
   UpdateRoomComponentVisuals (was updating ALL components including floor).

2. Stairwell room placement no longer destroys the source room's wall
   (stairwells are vertical connections, not horizontal doorways).
2026-04-09 07:56:42 -03:00
luis 477a2e0704 Housing: Fix interior decor not selectable — auto-assign empty RoomGuid
Decor placed before the room entity system had empty RoomGuid in DB.
Without a valid AttachParentGUID (Housing/2 room entity), the client
can't select the decor for moving/removing. Now auto-assigns decor with
empty RoomGuid to the first non-base room. Also uses FloorIndex for
room Z position in decor world coordinate calculation.
2026-04-09 07:55:32 -03:00
luis 1b6013497c Housing: Fix floor customization — treat TextureID 0xFFFFFFFF as default
The CMSG sends TextureID=4294967295 (0xFFFFFFFF) to mean "reset to
default". This was stored as WallpaperId and on respawn overrode the
texture lookup (WallpaperId != 0 → use -1 as texture). The client
showed an empty Floor Material dropdown because RoomComponentTextureID=-1.

Fix: treat WallpaperId=0xFFFFFFFF as 0 (no override) in both storage
and the spawn/update texture lookups. Also cleaned up -1 values in DB.

Note: RoomComponentOptionTexture DB2 table is empty in retail — Blizzard
hasn't populated it. Textures work via RoomComponentTexture (19 entries)
which the client reads directly by component type and theme.
2026-04-09 07:54:14 -03:00
luis de2256abcc typo 2026-04-08 21:11:52 -03:00
luis 9b41344828 typo 2026-04-08 20:09:01 -03:00
luis f200691b19 fix crash 2026-04-08 20:03:33 -03:00
luis 8e587eb900 fix sql 2026-04-08 19:47:18 -03:00
luis f5f53d6f13 typo 2026-04-08 19:40:56 -03:00
luis 167383c871 Housing: Fix stairwell Z offset + dye only affects specified components
1. Stairwell Z: Used room's own Height (14.0 for stairwells) instead of
   standard floor height (7.0). Stairwells spawned at Z=14.1 instead of
   7.1. Now uses fixed FLOOR_HEIGHT=7.0 for consistent floor spacing.

2. Dye wall/floor crossover: UpdateRoomComponentVisuals applied the theme
   to ALL components. Now filters by the CMSG's RoomComponentIDs — only
   the specified components are updated. Also uses the CMSG's theme ID
   directly instead of room.ThemeId (which is room-level, not per-component).
2026-04-08 19:37:22 -03:00
luis 3253902483 Housing: Implement multi-floor interior system for staircases
Rooms now have FloorIndex (0=ground, 1+=upper floors) persisted to DB.
Room Z position is calculated from FloorIndex * RoomWmoData.Height
(typically 7 yards per floor). Stairwell rooms (HasStairs flag) are
placed on FloorIndex+1 of the source room.

Changes:
- Room struct: added FloorIndex field
- DB: added floorIndex column to character_housing_rooms
- SpawnRoomMeshObjects: Z = originZ + FloorIndex * ceilingHeight
- HousingRoomEntity: FloorIndex set from room data (was hardcoded 0)
- HandleHousingRoomAdd: stairwell rooms go to FloorIndex+1
- SELECT/INSERT/UPDATE queries updated for floorIndex column
- Client door filtering uses FloorIndex to show/hide stair connections:
  Floor 0: hides downward stairs, Floor >=100: hides upward stairs
2026-04-08 19:33:57 -03:00
luis 86fa8081cd Housing: Fix interior dye + door teleport + decor selection prep
1. Dye: Sub-themes (e.g., 20=Folk Light) had no DB2 option entries.
   Added GetBaseThemeID() to convert sub-theme→base theme for lookup.
   Entity field gets the selected sub-theme, not the base.

2. Door GO teleport: Used cached _sourcePlotIndex=0. Now reads player's
   housing data directly (GetPlotIndex, GetNeighborhoodGuid) to find
   the correct exterior plot position.

3. Decor selection: Interior decor attaches to HousingRoomEntity (Housing
   GUID) instead of a MeshObject. Selection may require further work.
2026-04-08 19:28:39 -03:00
luis 415402966a Housing: Remove aggressive room migration that overwrites user placements
LoadFromDB migration replaced any non-Room-1 visual room with Room 1,
destroying user-placed rooms (Stairwell, Hallway, etc.) and resetting
gridX/gridY to 0 — causing rooms to overlap. Users can place ANY room
type as their visual room. Migration now only adds a default Room 1 if
the house has NO non-base rooms at all (empty house).
2026-04-08 14:37:02 -03:00
luis 5064bb65b8 Housing: Fix server crash — SetOwnerGUID aborts when owner already set by SummonGameObject 2026-04-08 13:27:02 -03:00
luis 9f7e181af9 Housing: Fix decor placement — send PLACE_RESPONSE before MeshObject CREATE
The client's placement state machine needs SMSG_HOUSING_DECOR_PLACE_RESPONSE
to finalize the current placement before receiving the UPDATE_OBJECT with the
new MeshObject. Wrong order (CREATE before RESPONSE) corrupted the state on
repeated placements, causing the preview to snap to camera ("flies to camera").

Packet order now: 1) PLACE_RESPONSE, 2) MeshObject CREATE, 3) Account update.
2026-04-08 13:25:48 -03:00
luis 770c8a2ead Housing: Fix interior door GO — use correct entry 575017 + displayId 113554
The interior exit door used entry 586576 (exterior door, displayId=116973)
which is invisible inside the interior. Retail uses entry 575017 with
displayId=113554 (standalone interior door model). Created GO template
with correct display, flags=0x40000, owner=HouseGUID.
2026-04-08 13:24:29 -03:00
luis a1297ae809 Housing: Fix interior door GO + room rotation in-place update
1. Interior door GO: The go_housing_door script only handled exterior
   (HousingMap) clicks. When clicked from interior (HouseInteriorMap),
   dynamic_cast failed → door did nothing. Now detects interior map and
   teleports player back to the neighborhood at the plot position.

2. Room rotation: Updates HousingRoomEntity orientation in-place via
   SetMirroredPosition() UPDATE_OBJECT instead of RefreshInteriorRoomVisuals.
2026-04-08 13:22:49 -03:00
luis 43c601c8ae Housing: Fix room rotation — in-place HousingRoomEntity orientation update
Room rotation now updates the HousingRoomEntity's FMirroredPositionData_C
orientation via SetMirroredPosition() instead of RefreshInteriorRoomVisuals
(which crashes). The client receives an UPDATE_OBJECT with the new rotation
quaternion and applies it visually without destroy+create.

Also added GetOriginX/Y/Z accessors to HouseInteriorMap.
2026-04-08 13:21:47 -03:00
luis 79b474834d Housing: Guard AddToWorld/RemoveFromWorld for housing session entities
HousingPlayerHouseEntity and HousingNeighborhoodMirrorEntity are
unique_ptr on WorldSession. Dereferencing them without null checks
crashes on fresh characters or edge cases where the session constructor
failed to initialize them. Added HasHousing*Entity() checks before
AddToWorld/RemoveFromWorld in Player::AddToWorld/RemoveFromWorld.
2026-04-08 13:18:33 -03:00
Céfiro_Caecias f398b21ad9 Update 2026_04_08_00_characters.sql.sql 2026-04-08 10:40:25 -03:00
luis d568a790be Housing: Fix decor placement crash — attach to Room entity not MeshObject
Interior decor used the first MeshObject GUID from _roomMeshObjects as
AttachParentGUID. After removing the root room MeshObject, this pointed
to a component MeshObject which the client couldn't resolve as a valid
parent (NULL+0x08). Sniff-verified: retail decor attaches to the
HousingRoomEntity (Housing/2 GUID), not a MeshObject.
2026-04-08 08:49:02 -03:00
luis 452f9fc846 Housing: Replace source wall with doorway when adding a room
When a room is added at a door pin, the source room's wall at that
connection was still showing as a solid Cosmetic wall (spawned before
the connection existed). Now ReplaceWallWithDoorway() destroys the
Cosmetic MeshObject and spawns DoorwayWall+Doorway MeshObjects in its
place, creating a visible passage between the rooms immediately.
2026-04-08 08:47:45 -03:00
luis d3887167b7 Housing: Fix room overlap — find wall offset without ConnectionType filter
Stairwell walls have ConnectionType=0, so the door offset lookup found no
opposite wall and defaulted to 0 → room placed at door position instead of
at the correct distance. Now searches for ANY wall in the opposite direction
(the furthest boundary) regardless of ConnectionType.

Also removed RefreshInteriorRoomVisuals from Rotate/Move/DoorType/CeilingType
handlers to prevent same-GUID DESTROY+CREATE crash.
2026-04-08 08:45:58 -03:00
luis 9ba677b2e0 Housing: Remove RefreshInteriorRoomVisuals from all handlers
RefreshInteriorRoomVisuals (destroy+create ALL rooms) crashes the client
with same-GUID DESTROY+CREATE in one packet. Removed from Rotate, Move,
SetDoorType, SetCeilingType handlers. These operations change metadata
only — the client handles visual updates from the response packet.

TODO: implement proper in-place UPDATE_OBJECT for room entity changes
(rotation, door type, ceiling type) instead of full visual refresh.
2026-04-08 08:44:21 -03:00
luis 6a2dd80d1e Housing: Fix door connections for yard-based room positions
Door adjacency checks used gridKey(GridX+1) which was correct for grid
indices but wrong for yard offsets. Entry at GridX=0 and Room1 at
GridX=15 are 15 yards apart, not 1 grid cell. Now uses findNeighborAtDoor
which searches all rooms in the door's facing direction instead of
looking for exact +1/-1 grid neighbors.
2026-04-08 08:42:22 -03:00
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