diff options
Diffstat (limited to 'src/server/game/Entities/Object')
| -rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/ObjectGuid.h | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 47751548922..0522ef13095 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2406,7 +2406,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float Map* map = GetMap(); GameObject* go = new GameObject(); - if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY)) + if (!go->Create(entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY)) { delete go; return NULL; diff --git a/src/server/game/Entities/Object/ObjectGuid.h b/src/server/game/Entities/Object/ObjectGuid.h index 000028ef852..aa7b4a4a23e 100644 --- a/src/server/game/Entities/Object/ObjectGuid.h +++ b/src/server/game/Entities/Object/ObjectGuid.h @@ -160,7 +160,6 @@ GUID_TRAIT_GLOBAL(HighGuid::CommerceObj) GUID_TRAIT_GLOBAL(HighGuid::ClientSession) GUID_TRAIT_REALM_SPECIFIC(HighGuid::Player) GUID_TRAIT_REALM_SPECIFIC(HighGuid::Item) // This is not exactly correct, there are 2 more unknown parts in highguid: (high >> 10 & 0xFF), (high >> 18 & 0xFFFFFF) -GUID_TRAIT_REALM_SPECIFIC(HighGuid::Transport) GUID_TRAIT_REALM_SPECIFIC(HighGuid::Guild) GUID_TRAIT_MAP_SPECIFIC(HighGuid::WorldTransaction) GUID_TRAIT_MAP_SPECIFIC(HighGuid::Conversation) @@ -183,6 +182,19 @@ GUID_TRAIT_MAP_SPECIFIC(HighGuid::AILock) GUID_TRAIT_MAP_SPECIFIC(HighGuid::AILockTicket) GUID_TRAIT_MAP_SPECIFIC(HighGuid::Cast) +// Special case +// Global transports are loaded from `transports` table, RealmSpecific part is used for them. +// after worldserver finishes loading, no more global transports can be created, only the ones existing within instances that never change maps +// here is where MapSpecific comes into play - each map takes over the responsibility to generate transport guids +// on top of this, regular elevators (GAMEOBJECT_TYPE_TRANSPORT) must also use Transport highguid type, otherwise client will reject seeing other players on them +template<> +struct ObjectGuidTraits<HighGuid::Transport> +{ + static bool const Global = false; + static bool const RealmSpecific = true; + static bool const MapSpecific = true; +}; + class ObjectGuid; class PackedGuid; @@ -207,7 +219,7 @@ class TC_GAME_API ObjectGuid static typename std::enable_if<ObjectGuidTraits<type>::RealmSpecific, ObjectGuid>::type Create(LowType counter) { return RealmSpecific(type, counter); } template<HighGuid type> - static typename std::enable_if<ObjectGuidTraits<type>::MapSpecific, ObjectGuid>::type Create(uint16 mapId, uint32 entry, LowType counter) { return MapSpecific(type, 0, mapId, 0, entry, counter); } + static typename std::enable_if<ObjectGuidTraits<type>::MapSpecific && type != HighGuid::Transport, ObjectGuid>::type Create(uint16 mapId, uint32 entry, LowType counter) { return MapSpecific(type, 0, mapId, 0, entry, counter); } template<HighGuid type> static typename std::enable_if<ObjectGuidTraits<type>::MapSpecific, ObjectGuid>::type Create(uint8 subType, uint16 mapId, uint32 entry, LowType counter) { return MapSpecific(type, subType, mapId, 0, entry, counter); } |
