1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Apply some of Vadim's changes

I intentionally didn't transfer changes in CLoadIntegrityValidator since not really agree with them.
This commit is contained in:
Arseniy Shestakov 2016-10-27 18:39:17 +03:00
parent 8f349b5105
commit 5f1254a29e
2 changed files with 9 additions and 2 deletions

View File

@ -314,7 +314,14 @@ public:
} }
else else
{ {
auto typeInfo = applier.getApplier(tid)->loadPtr(*this,&data, pid); auto app = applier.getApplier(tid);
if(app == nullptr)
{
logGlobal->error("load %d %d - no loader exists", tid, pid);
data = nullptr;
return;
}
auto typeInfo = app->loadPtr(*this,&data, pid);
data = reinterpret_cast<T>(typeList.castRaw((void*)data, typeInfo, &typeid(typename std::remove_const<typename std::remove_pointer<T>::type>::type))); data = reinterpret_cast<T>(typeList.castRaw((void*)data, typeInfo, &typeid(typename std::remove_const<typename std::remove_pointer<T>::type>::type)));
} }
} }

View File

@ -216,7 +216,7 @@ CPack * CConnection::retreivePack()
boost::unique_lock<boost::mutex> lock(*rmx); boost::unique_lock<boost::mutex> lock(*rmx);
logNetwork->traceStream() << "Listening... "; logNetwork->traceStream() << "Listening... ";
iser & ret; iser & ret;
logNetwork->traceStream() << "\treceived server message of type " << typeid(*ret).name() << ", data: " << ret; logNetwork->traceStream() << "\treceived server message of type " << (ret? typeid(*ret).name() : "nullptr") << ", data: " << ret;
return ret; return ret;
} }