- let's save the terrain properties as names so that they survive a change in the definition files.
This commit is contained in:
parent
7f454358b9
commit
23cfd29dbb
4 changed files with 30 additions and 2 deletions
|
|
@ -46,6 +46,7 @@
|
|||
#include "s_sound.h"
|
||||
#include "p_local.h"
|
||||
#include "templates.h"
|
||||
#include "farchive.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
|
|
@ -704,3 +705,26 @@ int P_FindTerrain (FName name)
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void P_SerializeTerrain(FArchive &arc, int &terrainnum)
|
||||
{
|
||||
FName val;
|
||||
if (arc.IsStoring())
|
||||
{
|
||||
if (terrainnum < 0 || terrainnum >= (int)Terrains.Size())
|
||||
{
|
||||
val = NAME_Null;
|
||||
}
|
||||
else
|
||||
{
|
||||
val = Terrains[terrainnum].Name;
|
||||
}
|
||||
arc << val;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << val;
|
||||
terrainnum = P_FindTerrain(val);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue