- Sync scripting branch with what was in trunk on Sunday. I believe that would be revision 2739.
SVN r2790 (scripting)
This commit is contained in:
commit
99670b708c
317 changed files with 17299 additions and 7273 deletions
|
|
@ -1917,6 +1917,22 @@ BYTE *FDynamicBuffer::GetData (int *len)
|
|||
}
|
||||
|
||||
|
||||
static int KillAll(const PClass *cls)
|
||||
{
|
||||
AActor *actor;
|
||||
int killcount = 0;
|
||||
TThinkerIterator<AActor> iterator(cls);
|
||||
while ( (actor = iterator.Next ()) )
|
||||
{
|
||||
if (actor->IsA(cls))
|
||||
{
|
||||
if (!(actor->flags2 & MF2_DORMANT) && (actor->flags3 & MF3_ISMONSTER))
|
||||
killcount += actor->Massacre ();
|
||||
}
|
||||
}
|
||||
return killcount;
|
||||
|
||||
}
|
||||
// [RH] Execute a special "ticcmd". The type byte should
|
||||
// have already been read, and the stream is positioned
|
||||
// at the beginning of the command's actual data.
|
||||
|
|
@ -2021,7 +2037,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
// Using LEVEL_NOINTERMISSION tends to throw the game out of sync.
|
||||
// That was a long time ago. Maybe it works now?
|
||||
level.flags |= LEVEL_CHANGEMAPCHEAT;
|
||||
G_ChangeLevel(s, pos, false);
|
||||
G_ChangeLevel(s, pos, 0);
|
||||
break;
|
||||
|
||||
case DEM_SUICIDE:
|
||||
|
|
@ -2348,22 +2364,25 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
|
||||
case DEM_KILLCLASSCHEAT:
|
||||
{
|
||||
AActor *actor;
|
||||
TThinkerIterator<AActor> iterator;
|
||||
|
||||
char *classname = ReadString (stream);
|
||||
int killcount = 0;
|
||||
PClassActor *cls = PClass::FindActor(classname);
|
||||
|
||||
while ( (actor = iterator.Next ()) )
|
||||
if (cls != NULL)
|
||||
{
|
||||
if (!stricmp (actor->GetClass ()->TypeName.GetChars (), classname))
|
||||
killcount = KillAll(cls);
|
||||
const PClass *cls_rep = cls->GetReplacement();
|
||||
if (cls != cls_rep)
|
||||
{
|
||||
if (!(actor->flags2 & MF2_DORMANT) && (actor->flags3 & MF3_ISMONSTER))
|
||||
killcount += actor->Massacre ();
|
||||
killcount += KillAll(cls_rep);
|
||||
}
|
||||
Printf ("Killed %d monsters of type %s.\n",killcount, classname);
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf ("%s is not an actor class.\n", classname);
|
||||
}
|
||||
|
||||
Printf ("Killed %d monsters of type %s.\n",killcount, classname);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue