- merge USDF branch into trunk.

- add USDF spexs.


SVN r2561 (trunk)
This commit is contained in:
Christoph Oelckers 2010-08-20 12:20:51 +00:00
commit b452bec0ee
23 changed files with 1226 additions and 273 deletions

View file

@ -361,65 +361,24 @@ void AActor::Serialize (FArchive &arc)
arc << foo;
}
if (arc.IsStoring ())
if (SaveVersion > 2500) // adjust after merging into trunk!
{
int convnum = 0;
unsigned int i;
if (Conversation != NULL)
{
for (i = 0; i < StrifeDialogues.Size(); ++i)
{
if (StrifeDialogues[i] == GetDefault()->Conversation)
{
break;
}
}
for (; i + convnum < StrifeDialogues.Size(); ++convnum)
{
if (StrifeDialogues[i + convnum] == Conversation)
{
break;
}
}
if (i + convnum < StrifeDialogues.Size())
{
convnum++;
}
else
{
convnum = 0;
}
}
arc.WriteCount (convnum);
arc << ConversationRoot << Conversation;
}
else
else // old code which uses relative indexing.
{
int convnum;
unsigned int i;
convnum = arc.ReadCount();
if (convnum == 0 || GetDefault()->Conversation == NULL)
if (convnum == 0)
{
Conversation = NULL;
ConversationRoot = -1;
}
else
{
for (i = 0; i < StrifeDialogues.Size(); ++i)
{
if (StrifeDialogues[i] == GetDefault()->Conversation)
{
break;
}
}
if (i + convnum <= StrifeDialogues.Size())
{
Conversation = StrifeDialogues[i + convnum - 1];
}
else
{
Conversation = GetDefault()->Conversation;
}
// This cannot be restored anymore.
I_Error("Cannot load old savegames with active dialogues");
}
}
@ -3482,6 +3441,7 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
return false; // we did the splash ourselves
}
//==========================================================================
//
// P_SpawnMobj
@ -3508,6 +3468,17 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
actor = static_cast<AActor *>(const_cast<PClass *>(type)->CreateNew ());
// Set default dialogue
actor->ConversationRoot = GetConversation(actor->GetClass()->TypeName);
if (actor->ConversationRoot != -1)
{
actor->Conversation = StrifeDialogues[actor->ConversationRoot];
}
else
{
actor->Conversation = NULL;
}
actor->x = actor->PrevX = ix;
actor->y = actor->PrevY = iy;
actor->z = actor->PrevZ = iz;