Disable world markers in battlegrounds via Map.dbc mapType check

Reads current map type from ObjMgr+0xCC -> Map.dbc row+0x08 and blocks
marker placement when mapType == 3 (battleground). Clearing markers
still works in BGs. Shows "World Markers unavailable in battlegrounds."
via the existing deny message system.
This commit is contained in:
MarcelineVQ
2026-03-10 11:29:13 -07:00
parent 3e2739dd91
commit e403ee18f2
3 changed files with 93 additions and 33 deletions
+24
View File
@@ -96,6 +96,30 @@ pub const WF_HIT_TERRAIN_Z: usize = 0x368;
/// Updated by the game as the player moves between areas.
pub const ZONE_AREA_ID: usize = 0x00B4E314;
// =============================================================================
// Map identification
// =============================================================================
/// Object Manager pointer - dereference once to get ObjMgr struct.
pub const OBJECT_MANAGER_PTR: usize = 0x00B41414;
/// ObjMgr + this → current map ID (u32). Same as ClntObjMgrGetMapId (0x468580).
pub const OBJMGR_MAP_ID_OFFSET: usize = 0xCC;
/// Pointer to Map.dbc indexed lookup table. Dereference to get table base,
/// then *(base + mapId * 4) → Map.dbc row pointer.
pub const MAP_DBC_DATA: usize = 0x00C0DAA8;
/// Pointer to Map.dbc max valid index. Dereference to get the max value.
pub const MAP_DBC_MAX: usize = 0x00C0DAAC;
/// Map.dbc row + this → mapType (u32). 0=world, 1=instance, 2=raid, 3=battleground.
/// Row layout: +0x00=mapId, +0x04=internalName(string), +0x08=mapType.
pub const MAP_DBC_MAP_TYPE_OFFSET: usize = 0x08;
/// MapType value for battleground instances.
pub const MAP_TYPE_BATTLEGROUND: u32 = 3;
// =============================================================================
// Per-frame world update
// =============================================================================