================ idScriptObject::Restore ================ */
| 925 | ================ |
| 926 | */ |
| 927 | void 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 | ============ |