MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / Restore

Method Restore

neo/d3xp/script/Script_Program.cpp:927–948  ·  view source on GitHub ↗

================ idScriptObject::Restore ================ */

Source from the content-addressed store, hash-verified

925================
926*/
927void idScriptObject::Restore( idRestoreGame *savefile ) {
928 idStr typeName;
929 int size;
930
931 savefile->ReadString( typeName );
932
933 // Empty string signals uninitialized object
934 if ( typeName.Length() == 0 ) {
935 return;
936 }
937
938 if ( !SetType( typeName ) ) {
939 savefile->Error( "idScriptObject::Restore: failed to restore object of type '%s'.", typeName.c_str() );
940 }
941
942 savefile->ReadInt( size );
943 if ( size != type->Size() ) {
944 savefile->Error( "idScriptObject::Restore: size of object '%s' doesn't match size in save game.", typeName.c_str() );
945 }
946
947 savefile->Read( data, size );
948}
949
950/*
951============

Callers

nothing calls this directly

Calls 11

ReadStringMethod · 0.45
LengthMethod · 0.45
ErrorMethod · 0.45
c_strMethod · 0.45
ReadIntMethod · 0.45
SizeMethod · 0.45
ReadMethod · 0.45
ReadByteMethod · 0.45
NumMethod · 0.45
GetBuildNumberMethod · 0.45
WarningMethod · 0.45

Tested by

no test coverage detected