Bumped savegame version for idLight::modelTarget

This commit is contained in:
Robert Beckebans 2024-05-16 21:41:29 +02:00
parent 1d5750569d
commit 2398670349
2 changed files with 24 additions and 4 deletions

View file

@ -276,6 +276,8 @@ idLight::idLight():
lightStyleBase.Set( 300, 300, 300 );
lightStyleState.Reset();
modelTarget = NULL;
// RB end
}
@ -324,6 +326,9 @@ void idLight::Save( idSaveGame* savefile ) const
savefile->WriteInt( fadeStart );
savefile->WriteInt( fadeEnd );
savefile->WriteBool( soundWasPlaying );
// RB: TODO light styles
modelTarget.Save( savefile );
}
/*
@ -360,6 +365,11 @@ void idLight::Restore( idRestoreGame* savefile )
savefile->ReadInt( fadeEnd );
savefile->ReadBool( soundWasPlaying );
if( savefile->GetBuildNumber() >= BUILD_NUMBER_SAVE_VERSION_LIGHT_MODELTARGET_CHANGE )
{
modelTarget.Restore( savefile );
}
lightDefHandle = -1;
SetLightLevel();
@ -520,6 +530,15 @@ void idLight::Spawn()
idClipModel::CheckModel( brokenModel );
}
// RB: link func_static modelTarget
//modelTarget = NULL;
const char* target = spawnArgs.GetString( "modelTarget" );
if( target != NULL && target[0] != '\0' )
{
PostEventMS( &EV_Light_UpdateModelTarget, 0 );
}
// RB end
PostEventMS( &EV_PostSpawn, 0 );
UpdateVisuals();

View file

@ -26,9 +26,10 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
const int BUILD_NUMBER_SAVE_VERSION_BEFORE_SKIP_CINEMATIC = 1400;
const int BUILD_NUMBER_SAVE_VERSION_CHANGE = 1401; // Altering saves so that the version goes in the Details file that we read in during the enumeration phase
const int BUILD_NUMBER_SAVE_VERSION_SCRIPT_CHANGES1 = 1402; // RB: Merged script compiler changes from Dhewm3 so functions don't need declarations before used
const int BUILD_NUMBER_SAVE_VERSION_BEFORE_SKIP_CINEMATIC = 1400;
const int BUILD_NUMBER_SAVE_VERSION_CHANGE = 1401; // Altering saves so that the version goes in the Details file that we read in during the enumeration phase
const int BUILD_NUMBER_SAVE_VERSION_SCRIPT_CHANGES1 = 1402; // RB: Merged script compiler changes from Dhewm3 so functions don't need declarations before used
const int BUILD_NUMBER_SAVE_VERSION_LIGHT_MODELTARGET_CHANGE = 1403; // RB: added idLight::modelTarget entity pointer
const int BUILD_NUMBER = BUILD_NUMBER_SAVE_VERSION_SCRIPT_CHANGES1;
const int BUILD_NUMBER = BUILD_NUMBER_SAVE_VERSION_LIGHT_MODELTARGET_CHANGE;
const int BUILD_NUMBER_MINOR = 0;