- added APROP_ViewHeight and APROP_AttackZOffset submission by TheFortuneTeller.

This commit is contained in:
Christoph Oelckers 2013-08-09 12:06:51 +02:00
parent 34b71baad1
commit b187451a71
1 changed files with 31 additions and 0 deletions

View File

@ -3512,6 +3512,8 @@ enum
APROP_Radius = 36,
APROP_ReactionTime = 37,
APROP_MeleeRange = 38,
APROP_ViewHeight = 39,
APROP_AttackZOffset = 40
};
// These are needed for ACS's APROP_RenderStyle
@ -3727,6 +3729,16 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
actor->reactiontime = value;
break;
case APROP_ViewHeight:
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
static_cast<APlayerPawn *>(actor)->ViewHeight = value;
break;
case APROP_AttackZOffset:
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
static_cast<APlayerPawn *>(actor)->AttackZOffset = value;
break;
default:
// do nothing.
break;
@ -3799,6 +3811,23 @@ int DLevelScript::GetActorProperty (int tid, int property, const SDWORD *stack,
case APROP_Radius: return actor->radius;
case APROP_ReactionTime:return actor->reactiontime;
case APROP_MeleeRange: return actor->meleerange;
case APROP_ViewHeight: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
return static_cast<APlayerPawn *>(actor)->ViewHeight;
}
else
{
return 0;
}
case APROP_AttackZOffset:
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
return static_cast<APlayerPawn *>(actor)->AttackZOffset;
}
else
{
return 0;
}
case APROP_SeeSound: return GlobalACSStrings.AddString(actor->SeeSound, stack, stackdepth);
case APROP_AttackSound: return GlobalACSStrings.AddString(actor->AttackSound, stack, stackdepth);
@ -3851,6 +3880,8 @@ int DLevelScript::CheckActorProperty (int tid, int property, int value)
case APROP_Radius:
case APROP_ReactionTime:
case APROP_MeleeRange:
case APROP_ViewHeight:
case APROP_AttackZOffset:
return (GetActorProperty(tid, property, NULL, 0) == value);
// Boolean values need to compare to a binary version of value