SVN r71 (trunk)

This commit is contained in:
Christoph Oelckers 2006-04-30 21:49:18 +00:00
commit 29cd024aba
31 changed files with 1718 additions and 1105 deletions

View file

@ -331,45 +331,6 @@ void DCorpsePointer::Serialize (FArchive &arc)
arc << Corpse << Count;
}
// Pointers to members cannot be assigned to single array elements,
// so this class is deprecated. It exists now only for compatibility with
// old savegames.
class DCorpseQueue : public DThinker
{
DECLARE_CLASS (DCorpseQueue, DThinker)
HAS_OBJECT_POINTERS
public:
void Serialize (FArchive &arc);
void Tick ();
protected:
AActor *CorpseQueue[CORPSEQUEUESIZE];
};
IMPLEMENT_CLASS(DCorpseQueue)
void DCorpseQueue::Serialize (FArchive &arc)
{
int foo = 0;
int i;
Super::Serialize (arc);
for (i = 0; i < CORPSEQUEUESIZE; ++i)
arc << CorpseQueue[i];
arc << foo;
}
void DCorpseQueue::Tick ()
{
for (int i = 0; i < CORPSEQUEUESIZE; ++i)
{
if (CorpseQueue[i] != NULL)
{
new DCorpsePointer (CorpseQueue[i]);
}
}
Destroy ();
}
// throw another corpse on the queue
void A_QueueCorpse (AActor *actor)

View file

@ -812,6 +812,40 @@ void AInventory::Hide ()
}
}
//===========================================================================
//
//
//===========================================================================
static void PrintPickupMessage (const char *str)
{
if (str != NULL)
{
string temp;
if (strchr (str, '$'))
{
// The message or part of it is from the LANGUAGE lump
string name;
size_t part1 = strcspn (str, "$");
temp = string(str, part1);
size_t part2 = strcspn (str + part1 + 1, "$");
name = string(str + part1 + 1, part2);
temp += GStrings(name.GetChars());
if (str[part1 + 1 + part2] == '$')
{
temp += str + part1 + part2 + 2;
}
str = temp.GetChars();
}
Printf (PRINT_LOW, "%s\n", str);
}
}
//===========================================================================
//
// AInventory :: Touch
@ -845,7 +879,7 @@ void AInventory::Touch (AActor *toucher)
{
StaticLastMessageTic = gametic;
StaticLastMessage = message;
Printf (PRINT_LOW, "%s\n", message);
PrintPickupMessage (message);
StatusBar->FlashCrosshair ();
}
@ -860,7 +894,7 @@ void AInventory::Touch (AActor *toucher)
{
PlayPickupSound (toucher);
}
}
}
// [RH] Execute an attached special (if any)
DoPickupSpecial (toucher);