builtin: Switch to correct get_x() nullptr convention

This commit is contained in:
Perttu Ahola 2014-10-28 14:49:42 +02:00
parent 54e1ec778a
commit 533c96e17d
5 changed files with 5 additions and 6 deletions

View File

@ -455,7 +455,7 @@ struct Module: public interface::Module, public ground_plane_lighting::Interface
{ {
auto it = m_instances.find(scene_ref); auto it = m_instances.find(scene_ref);
if(it == m_instances.end()) if(it == m_instances.end())
throw Exception("get_instance(): Scene does not have gpl"); return nullptr;
return it->second.get(); return it->second.get();
} }

View File

@ -128,7 +128,7 @@ namespace voxelworld
std::function<void(voxelworld::Instance *instance)> cb) std::function<void(voxelworld::Instance *instance)> cb)
{ {
return access(server, [&](voxelworld::Interface *i){ return access(server, [&](voxelworld::Interface *i){
voxelworld::Instance *instance = i->get_instance(scene_ref); voxelworld::Instance *instance = check(i->get_instance(scene_ref));
cb(instance); cb(instance);
}); });
} }

View File

@ -1209,8 +1209,7 @@ struct Module: public interface::Module, public voxelworld::Interface
{ {
auto it = m_instances.find(scene_ref); auto it = m_instances.find(scene_ref);
if(it == m_instances.end()) if(it == m_instances.end())
throw Exception("get_instance(): Scene does not have a voxel" return nullptr;
" world instance");
return it->second.get(); return it->second.get();
} }

View File

@ -62,7 +62,7 @@ namespace worldgen
std::function<void(worldgen::Instance *instance)> cb) std::function<void(worldgen::Instance *instance)> cb)
{ {
return access(server, [&](worldgen::Interface *i){ return access(server, [&](worldgen::Interface *i){
worldgen::Instance *instance = i->get_instance(scene_ref); worldgen::Instance *instance = check(i->get_instance(scene_ref));
cb(instance); cb(instance);
}); });
} }

View File

@ -216,7 +216,7 @@ struct Module: public interface::Module, public Interface
{ {
auto it = m_instances.find(scene_ref); auto it = m_instances.find(scene_ref);
if(it == m_instances.end()) if(it == m_instances.end())
throw Exception("get_instance(): Scene does not have worldgen"); return nullptr;
return it->second.get(); return it->second.get();
} }