- added a fixed version of Demolisher's GetActor** submission for returning the activator's info when the tid is 0.

SVN r2787 (trunk)
This commit is contained in:
Christoph Oelckers 2010-09-15 21:41:49 +00:00
parent 5dfc57336e
commit 106cf82f62

View file

@ -5834,15 +5834,22 @@ int DLevelScript::RunScript ()
case PCD_GETACTORY: case PCD_GETACTORY:
case PCD_GETACTORZ: case PCD_GETACTORZ:
{ {
AActor *actor = SingleActorFromTID (STACK(1), activator); if(STACK(1) == 0)
if (actor == NULL)
{ {
STACK(1) = 0; STACK(1) = (&activator->x)[pcd - PCD_GETACTORX];
} }
else else
{ {
STACK(1) = (&actor->x)[pcd - PCD_GETACTORX]; AActor *actor = SingleActorFromTID (STACK(1), activator);
if (actor == NULL)
{
STACK(1) = 0;
}
else
{
STACK(1) = (&actor->x)[pcd - PCD_GETACTORX];
}
} }
} }
break; break;
@ -5850,50 +5857,77 @@ int DLevelScript::RunScript ()
case PCD_GETACTORFLOORZ: case PCD_GETACTORFLOORZ:
case PCD_GETACTORCEILINGZ: case PCD_GETACTORCEILINGZ:
{ {
AActor *actor = SingleActorFromTID (STACK(1), activator); if(STACK(1) == 0)
if (actor == NULL)
{ {
STACK(1) = 0; if (pcd == PCD_GETACTORFLOORZ)
} {
else if (pcd == PCD_GETACTORFLOORZ) STACK(1) = activator->floorz;
{ }
STACK(1) = actor->floorz; else if(STACK(1) == 0)
{
STACK(1) = activator->ceilingz;
}
} }
else else
{ {
STACK(1) = actor->ceilingz; AActor *actor = SingleActorFromTID (STACK(1), activator);
}
if (actor == NULL)
{
STACK(1) = 0;
}
else if (pcd == PCD_GETACTORFLOORZ)
{
STACK(1) = actor->floorz;
}
else
{
STACK(1) = actor->ceilingz;
}
}
} }
break; break;
case PCD_GETACTORANGLE: case PCD_GETACTORANGLE:
{ {
AActor *actor = SingleActorFromTID (STACK(1), activator); if(STACK(1) == 0)
if (actor == NULL)
{ {
STACK(1) = 0; STACK(1) = activator->angle >> 16;
} }
else else
{ {
STACK(1) = actor->angle >> 16; AActor *actor = SingleActorFromTID (STACK(1), activator);
if (actor == NULL)
{
STACK(1) = 0;
}
else
{
STACK(1) = actor->angle >> 16;
}
} }
} }
break; break;
case PCD_GETACTORPITCH: case PCD_GETACTORPITCH:
{ {
AActor *actor = SingleActorFromTID (STACK(1), activator); if(STACK(1) == 0)
if (actor == NULL)
{ {
STACK(1) = 0; STACK(1) = activator->pitch >> 16;
} }
else else
{ {
STACK(1) = actor->pitch >> 16; AActor *actor = SingleActorFromTID (STACK(1), activator);
if (actor == NULL)
{
STACK(1) = 0;
}
else
{
STACK(1) = actor->pitch >> 16;
}
} }
} }
break; break;