Skip to content

An OpenMW mod that lets you play the whole Elder Scrolls III: Morrowind as a top-down isometric game — with full online co-op or MMO modes.

C++
713 B
Raw Blame
#include "actoridconverter.hpp"

namespace ESM
{
    void ActorIdConverter::apply()
    {
        for (auto& [refNum, actorId] : mToConvert)
        {
            auto it = mMappings.find(actorId);
            if (it == mMappings.end())
                refNum = {};
            else
                refNum = it->second;
        }
    }

    void ActorIdConverter::convert(ESM::RefNum& refNum, int actorId)
    {
        if (actorId == -1)
        {
            refNum = {};
            return;
        }
        auto it = mMappings.find(actorId);
        if (it == mMappings.end())
        {
            mToConvert.emplace_back(refNum, actorId);
            return;
        }
        refNum = it->second;
    }
}