1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00
OpenMW/apps/openmw/mwclass/itemlevlist.cpp
Bo Svensson ef906cbfa8
improves MWClass mapping (#3166)
Currently, we use a peculiar mapping of ESM classes by their std::type_info::name. This mapping is an undefined behaviour because std::type_info::name is strictly implementation defined. It could return a non-unique value on some platforms. With this PR we use the unsigned int sRecordId of the ESM class as a more efficient lookup type that does not build on undefined behaviour. We can expect marginally faster save-game loading with these changes as well.
2021-10-11 13:46:21 +02:00

25 lines
476 B
C++

#include "itemlevlist.hpp"
#include <components/esm/loadlevlist.hpp>
namespace MWClass
{
std::string ItemLevList::getName (const MWWorld::ConstPtr& ptr) const
{
return "";
}
bool ItemLevList::hasToolTip(const MWWorld::ConstPtr& ptr) const
{
return false;
}
void ItemLevList::registerSelf()
{
std::shared_ptr<Class> instance (new ItemLevList);
registerClass (ESM::ItemLevList::sRecordId, instance);
}
}