================ idDemoFile::ReadHashString ================ */
| 214 | ================ |
| 215 | */ |
| 216 | const char *idDemoFile::ReadHashString() { |
| 217 | int index; |
| 218 | |
| 219 | if ( log && fLog ) { |
| 220 | const char *text = va( "%s > Reading hash string\n", logStr.c_str() ); |
| 221 | fLog->Write( text, strlen( text ) ); |
| 222 | } |
| 223 | |
| 224 | ReadInt( index ); |
| 225 | |
| 226 | if ( index == -1 ) { |
| 227 | // read a new string for the table |
| 228 | idStr *str = new idStr; |
| 229 | |
| 230 | idStr data; |
| 231 | ReadString( data ); |
| 232 | *str = data; |
| 233 | |
| 234 | demoStrings.Append( str ); |
| 235 | |
| 236 | return *str; |
| 237 | } |
| 238 | |
| 239 | if ( index < -1 || index >= demoStrings.Num() ) { |
| 240 | Close(); |
| 241 | common->Error( "demo hash index out of range" ); |
| 242 | } |
| 243 | |
| 244 | return demoStrings[index]->c_str(); |
| 245 | } |
| 246 | |
| 247 | /* |
| 248 | ================ |
no test coverage detected