|
|
|
@ -49,16 +49,16 @@ void plLoadAgeMsg::Read(hsStream* stream, hsResMgr* mgr)
|
|
|
|
|
{
|
|
|
|
|
plMessage::IMsgRead(stream, mgr);
|
|
|
|
|
|
|
|
|
|
delete [] fAgeFilename; |
|
|
|
|
|
|
|
|
|
// read agename
|
|
|
|
|
uint8_t len; |
|
|
|
|
stream->ReadLE(&len); |
|
|
|
|
if (len) |
|
|
|
|
{ |
|
|
|
|
fAgeFilename=new char[len+1]; |
|
|
|
|
stream->Read(len, fAgeFilename); |
|
|
|
|
fAgeFilename[len]=0; |
|
|
|
|
plStringBuffer<char> filename; |
|
|
|
|
char* buffer = filename.CreateWritableBuffer(len); |
|
|
|
|
stream->Read(len, buffer); |
|
|
|
|
buffer[len] = 0; |
|
|
|
|
fAgeFilename = filename; |
|
|
|
|
} |
|
|
|
|
fUnload = stream->ReadBool(); |
|
|
|
|
stream->ReadLE(&fPlayerID); |
|
|
|
@ -70,11 +70,11 @@ void plLoadAgeMsg::Write(hsStream* stream, hsResMgr* mgr)
|
|
|
|
|
plMessage::IMsgWrite(stream, mgr);
|
|
|
|
|
|
|
|
|
|
// write agename
|
|
|
|
|
uint8_t len = fAgeFilename ? strlen(fAgeFilename) : 0; |
|
|
|
|
uint8_t len = static_cast<uint8_t>(fAgeFilename.GetSize()); |
|
|
|
|
stream->WriteLE(len); |
|
|
|
|
if (len) |
|
|
|
|
{ |
|
|
|
|
stream->Write(len, fAgeFilename); |
|
|
|
|
stream->Write(len, fAgeFilename.c_str()); |
|
|
|
|
} |
|
|
|
|
stream->WriteBool(fUnload); |
|
|
|
|
stream->WriteLE(fPlayerID); |
|
|
|
@ -99,8 +99,7 @@ void plLoadAgeMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
|
|
|
|
if (contentFlags.IsBitSet(kLoadAgeAgeName)) |
|
|
|
|
{ |
|
|
|
|
// read agename
|
|
|
|
|
delete [] fAgeFilename; |
|
|
|
|
fAgeFilename = s->ReadSafeString(); |
|
|
|
|
fAgeFilename = s->ReadSafeString_TEMP(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (contentFlags.IsBitSet(kLoadAgeUnload)) |
|
|
|
|