Core/Vehicles:
- Remove some wrong checks in vehicle_accessory loading. - Remove Reset() call from Vehicle::Install() - reset is already called by AI functions
This commit is contained in:
@@ -114,8 +114,6 @@ void Vehicle::Install()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reset();
|
|
||||||
|
|
||||||
if (GetBase()->GetTypeId() == TYPEID_UNIT)
|
if (GetBase()->GetTypeId() == TYPEID_UNIT)
|
||||||
sScriptMgr->OnInstall(this);
|
sScriptMgr->OnInstall(this);
|
||||||
}
|
}
|
||||||
@@ -223,6 +221,7 @@ int8 Vehicle::GetNextEmptySeat(int8 seatId, bool next) const
|
|||||||
|
|
||||||
void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 type, uint32 summonTime)
|
void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 type, uint32 summonTime)
|
||||||
{
|
{
|
||||||
|
sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle: Installing accessory entry %u on vehicle entry %u (seat:%i)", entry, GetCreatureEntry(), seatId);
|
||||||
if (Unit *passenger = GetPassenger(seatId))
|
if (Unit *passenger = GetPassenger(seatId))
|
||||||
{
|
{
|
||||||
// already installed
|
// already installed
|
||||||
|
|||||||
@@ -2793,7 +2793,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
|
|||||||
}
|
}
|
||||||
while (result->NextRow());
|
while (result->NextRow());
|
||||||
|
|
||||||
sLog->outString(">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
sLog->outString(">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||||
sLog->outString();
|
sLog->outString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2818,32 +2818,20 @@ void ObjectMgr::LoadVehicleAccessories()
|
|||||||
{
|
{
|
||||||
Field *fields = result->Fetch();
|
Field *fields = result->Fetch();
|
||||||
|
|
||||||
uint32 uiEntry = fields[0].GetUInt32();
|
uint32 uiGUID = fields[0].GetUInt32();
|
||||||
uint32 uiAccessory = fields[1].GetUInt32();
|
uint32 uiAccessory = fields[1].GetUInt32();
|
||||||
int8 uiSeat = int8(fields[2].GetInt16());
|
int8 uiSeat = int8(fields[2].GetInt16());
|
||||||
bool bMinion = fields[3].GetBool();
|
bool bMinion = fields[3].GetBool();
|
||||||
uint8 uiSummonType = fields[4].GetUInt8();
|
uint8 uiSummonType = fields[4].GetUInt8();
|
||||||
uint32 uiSummonTimer= fields[5].GetUInt32();
|
uint32 uiSummonTimer= fields[5].GetUInt32();
|
||||||
|
|
||||||
if (!sCreatureStorage.LookupEntry<CreatureInfo>(uiEntry))
|
|
||||||
{
|
|
||||||
sLog->outErrorDb("Table `vehicle_accessory`: creature template entry %u does not exist.", uiEntry);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!sCreatureStorage.LookupEntry<CreatureInfo>(uiAccessory))
|
if (!sCreatureStorage.LookupEntry<CreatureInfo>(uiAccessory))
|
||||||
{
|
{
|
||||||
sLog->outErrorDb("Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory);
|
sLog->outErrorDb("Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSpellClickInfoMap.find(uiEntry) == mSpellClickInfoMap.end())
|
m_VehicleAccessoryMap[uiGUID].push_back(VehicleAccessory(uiAccessory, uiSeat, bMinion, uiSummonType, uiSummonTimer));
|
||||||
{
|
|
||||||
sLog->outErrorDb("Table `vehicle_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_VehicleAccessoryMap[uiEntry].push_back(VehicleAccessory(uiAccessory, uiSeat, bMinion, uiSummonType, uiSummonTimer));
|
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user