diff --git a/d3xp/gamesys/Event.cpp b/d3xp/gamesys/Event.cpp index 8b5b474..09b1147 100644 --- a/d3xp/gamesys/Event.cpp +++ b/d3xp/gamesys/Event.cpp @@ -755,6 +755,7 @@ void idEvent::Save( idSaveGame *savefile ) { byte *dataPtr; bool validTrace; const char *format; + idStr s; savefile->WriteInt( EventQueue.Num() ); @@ -783,6 +784,12 @@ void idEvent::Save( idSaveGame *savefile ) { savefile->WriteVec3( *reinterpret_cast( dataPtr ) ); size += sizeof( idVec3 ); break; + case D_EVENT_STRING : + s.Clear(); + s.Append(reinterpret_cast(dataPtr), MAX_STRING_LEN); + savefile->WriteString(s); + size += MAX_STRING_LEN; + break; case D_EVENT_TRACE : validTrace = *reinterpret_cast( dataPtr ); savefile->WriteBool( validTrace ); @@ -836,6 +843,7 @@ void idEvent::Restore( idRestoreGame *savefile ) { byte *dataPtr; idEvent *event; const char *format; + idStr s; savefile->ReadInt( num ); @@ -892,6 +900,11 @@ void idEvent::Restore( idRestoreGame *savefile ) { savefile->ReadVec3( *reinterpret_cast( dataPtr ) ); size += sizeof( idVec3 ); break; + case D_EVENT_STRING : + savefile->ReadString(s); + idStr::Copynz(reinterpret_cast(dataPtr), s, MAX_STRING_LEN); + size += MAX_STRING_LEN; + break; case D_EVENT_TRACE : savefile->ReadBool( *reinterpret_cast( dataPtr ) ); size += sizeof( bool ); diff --git a/game/gamesys/Event.cpp b/game/gamesys/Event.cpp index 24b1c41..e2a62a5 100644 --- a/game/gamesys/Event.cpp +++ b/game/gamesys/Event.cpp @@ -621,6 +621,7 @@ void idEvent::Save( idSaveGame *savefile ) { byte *dataPtr; bool validTrace; const char *format; + idStr s; savefile->WriteInt( EventQueue.Num() ); @@ -649,6 +650,12 @@ void idEvent::Save( idSaveGame *savefile ) { savefile->WriteVec3( *reinterpret_cast( dataPtr ) ); size += sizeof( idVec3 ); break; + case D_EVENT_STRING : + s.Clear(); + s.Append(reinterpret_cast(dataPtr), MAX_STRING_LEN); + savefile->WriteString(s); + size += MAX_STRING_LEN; + break; case D_EVENT_TRACE : validTrace = *reinterpret_cast( dataPtr ); savefile->WriteBool( validTrace ); @@ -685,6 +692,7 @@ void idEvent::Restore( idRestoreGame *savefile ) { byte *dataPtr; idEvent *event; const char *format; + idStr s; savefile->ReadInt( num ); @@ -741,6 +749,11 @@ void idEvent::Restore( idRestoreGame *savefile ) { savefile->ReadVec3( *reinterpret_cast( dataPtr ) ); size += sizeof( idVec3 ); break; + case D_EVENT_STRING : + savefile->ReadString(s); + idStr::Copynz(reinterpret_cast(dataPtr), s, MAX_STRING_LEN); + size += MAX_STRING_LEN; + break; case D_EVENT_TRACE : savefile->ReadBool( *reinterpret_cast( dataPtr ) ); size += sizeof( bool );