Example:
override bool OnStoreLoad( ParamsReadContext ctx, int version ) { if(!super.OnStoreLoad(ctx, version)); return false; int test_load0 = 0; int test_load1 = 0; int test_load2 = 0; int test_load3 = 0; int test_load4 = 0; if (!ctx.Read( test_load0 )) return false; Print(test_load0); if (!ctx.Read( test_load1 )) return false; Print(test_load1); if (!ctx.Read( test_load2 )) return false; Print(test_load2); if (!ctx.Read( test_load3 )) return false; Print(test_load3); if (!ctx.Read( test_load4 )) return false; Print(test_load4); return true; }
For example, this code leads to the fact that each check is performed and approximately following lines appear in the log.
SCRIPT (E): [EntityAI::OnStoreLoad] :: [WARNING] :: Scripted variables corrupted upon "CivilianSedan". SCRIPT : int test_load0 = 60 SCRIPT : int test_load1 = 1065353216 SCRIPT : int test_load2 = 1065353216 SCRIPT : int test_load3 = 1065353216 SCRIPT : int test_load4 = 1065353216