コード例 #1
0
ファイル: mapbuffer.cpp プロジェクト: NateBrune/Cataclysm-DDA
submap *mapbuffer::lookup_submap( const tripoint &p )
{
    dbg(D_INFO) << "mapbuffer::lookup_submap( x[" << p.x << "], y[" << p.y << "], z[" << p.z << "])";

    auto iter = submaps.find( p );
    if( iter == submaps.end() ) {
        try {
            return unserialize_submaps( p );
        } catch (const std::exception &err) {
            debugmsg("Failed to load submap (%d,%d,%d): %s", p.x, p.y, p.z, err.what());
        }
        return NULL;
    }

    return iter->second;
}
コード例 #2
0
ファイル: mapbuffer.cpp プロジェクト: Antistar/Cataclysm-DDA
submap *mapbuffer::lookup_submap(int x, int y, int z)
{
    dbg(D_INFO) << "mapbuffer::lookup_submap( x[" << x << "], y[" << y << "], z[" << z << "])";

    const tripoint p(x, y, z);
    if (submaps.count(p) == 0) {
        try {
            return unserialize_submaps( p );
        } catch (std::string &err) {
            debugmsg("Failed to load submap (%d,%d,%d): %s", x, y, z, err.c_str());
        } catch (const std::exception &err) {
            debugmsg("Failed to load submap (%d,%d,%d): %s", x, y, z, err.what());
        }
        return NULL;
    }

    return submaps[p];
}