- changed Polyobject thinkers to operate on the actual polyobjects instead of indices

This also changes the action special interface to pass a Level parameter to the separate functions and makes a few other minor adjustments to the polyobject code.
This commit is contained in:
Christoph Oelckers 2019-01-24 01:05:07 +01:00
commit 9f8dd66189
15 changed files with 331 additions and 348 deletions

View file

@ -5654,7 +5654,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args)
const char *seqname = level.Behaviors.LookupString(args[1]);
if (seqname != NULL)
{
FPolyObj *poly = PO_GetPolyobj(args[0]);
FPolyObj *poly = level.GetPolyobj(args[0]);
if (poly != NULL)
{
SN_StartSequence(poly, seqname, 0);
@ -5665,7 +5665,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args)
case ACSF_GetPolyobjX:
{
FPolyObj *poly = PO_GetPolyobj(args[0]);
FPolyObj *poly = level.GetPolyobj(args[0]);
if (poly != NULL)
{
return DoubleToACS(poly->StartSpot.pos.X);
@ -5675,7 +5675,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args)
case ACSF_GetPolyobjY:
{
FPolyObj *poly = PO_GetPolyobj(args[0]);
FPolyObj *poly = level.GetPolyobj(args[0]);
if (poly != NULL)
{
return DoubleToACS(poly->StartSpot.pos.Y);
@ -6817,7 +6817,7 @@ int DLevelScript::RunScript ()
case SCRIPT_PolyWait:
// Wait for polyobj(s) to stop moving, then enter state running
if (!PO_Busy (statedata))
if (!PO_Busy (&level, statedata))
{
state = SCRIPT_Running;
}