17 typedef std::vector<LegacyTransportEntry> LegacyTransportEntryStore;
19 LegacyTransportEntryStore& GetLegacyTransportEntries()
21 static LegacyTransportEntryStore entries;
25 LegacyTransportEntryStore::const_iterator FindByDbEntry(
uint32 dbEntry)
27 LegacyTransportEntryStore
const& entries = GetLegacyTransportEntries();
30 return entry.DbEntry == dbEntry;
34 LegacyTransportEntryStore::const_iterator FindByClientEntry(
uint32 clientEntry)
36 LegacyTransportEntryStore
const& entries = GetLegacyTransportEntries();
37 return std::find_if(entries.begin(), entries.end(), [clientEntry](
LegacyTransportEntry const& entry)
39 return entry.ClientEntry == clientEntry;
45 return (entry.Flags & flag) != 0;
51 GetLegacyTransportEntries().clear();
59 LegacyTransportEntryStore& entries = GetLegacyTransportEntries();
60 for (LegacyTransportEntryStore::const_iterator itr = entries.begin(); itr != entries.end(); ++itr)
69 entries.push_back(entry);
75 LegacyTransportEntryStore::const_iterator itr = FindByDbEntry(dbEntry);
81 LegacyTransportEntryStore::const_iterator itr = FindByClientEntry(clientEntry);
87 return FindByDbEntry(dbEntry) != GetLegacyTransportEntries().end();
92 LegacyTransportEntryStore::const_iterator itr = FindByDbEntry(dbEntry);
93 return itr != GetLegacyTransportEntries().end() ? itr->ClientEntry : dbEntry;
98 uint32 allowedSpawnMask = 0;
99 LegacyTransportEntryStore
const& entries = GetLegacyTransportEntries();
100 for (LegacyTransportEntryStore::const_iterator itr = entries.begin(); itr != entries.end(); ++itr)
101 if (itr->DbEntry == dbEntry && itr->MapId == mapId)
102 allowedSpawnMask |= itr->SpawnMask & spawnMask;
104 return allowedSpawnMask;
bool ShouldPreservePassengerGameObjectVisibility(uint32 clientEntry)
void LogMissingAnimationData(uint32, uint32, uint32)
bool IsDeeprunSubwayClientEntry(uint32 clientEntry)
void ClearLegacyTransportEntries()
@ LEGACY_TRANSPORT_FLAG_PRESERVE_PASSENGER_GAMEOBJECT_VISIBILITY
void LogRegisteredSpawn(LegacyTransportSpawnDiagnostic const &)
bool IsDeeprunSubwayDbEntry(uint32 dbEntry)
void LogCreateAttempt(LegacyTransportSpawnDiagnostic const &)
uint32 GetClientEntryForDbEntry(uint32 dbEntry)
void LogCreateFailure(LegacyTransportSpawnDiagnostic const &)
void LogCreateSuccess(LegacyTransportSpawnDiagnostic const &, uint64, uint32, uint32, uint32, uint32, uint32, uint32, uint32)
bool IsLocalTransportDbEntry(uint32 dbEntry)
void LogMissingCreateAnimationData(uint32, uint32, uint32)
void LogNoRegisteredSpawns(uint32, uint32)
bool IsAllowedOnMap(uint32 dbEntry, uint32 mapId, uint32 spawnMode)
void LogSpawnCount(uint32, uint32, uint32)
uint32 GetAllowedSpawnMask(uint32 dbEntry, uint32 mapId, uint32 spawnMask)
bool AddLegacyTransportEntry(LegacyTransportEntry const &entry)
int HasFlag(lua_State *L, Object *obj)