Bug fixes

This commit is contained in:
Jackie Liu committed 2022-09-29 01:28:14 -07:00
1 parent 7c34cd743a
commit ffbadeec5e
2 files changed
+27 -20

No files matched your search

+26 -19
View File
@@ -38,8 +38,11 @@ namespace Pal3.Actor
get => _actor.IsActive;
set
{
_actor.IsActive = value;
if (value) Activate();
if (value)
{
Activate();
_actor.IsActive = true;
}
else DeActivate();
}
}
@@ -98,24 +101,28 @@ namespace Pal3.Actor
return;
}
switch (_actor.Info.InitBehaviour)
// Perform init action
if (!_actor.IsActive)
{
case ScnActorBehaviour.None:
_currentBehaviour = ScnActorBehaviour.None;
_actionController.PerformAction(_actor.GetInitAction());
break;
case ScnActorBehaviour.Hold:
_currentBehaviour = ScnActorBehaviour.Hold;
_actionController.PerformAction(_actor.GetInitAction());
break;
case ScnActorBehaviour.Wander:
_currentBehaviour = ScnActorBehaviour.Wander;
_actionController.PerformAction(_actor.GetIdleAction());
break;
case ScnActorBehaviour.PathFollow:
_currentBehaviour = ScnActorBehaviour.PathFollow;
_actionController.PerformAction(_actor.GetIdleAction());
break;
switch (_actor.Info.InitBehaviour)
{
case ScnActorBehaviour.None:
_currentBehaviour = ScnActorBehaviour.None;
_actionController.PerformAction(_actor.GetInitAction());
break;
case ScnActorBehaviour.Hold:
_currentBehaviour = ScnActorBehaviour.Hold;
_actionController.PerformAction(_actor.GetInitAction());
break;
case ScnActorBehaviour.Wander:
_currentBehaviour = ScnActorBehaviour.Wander;
_actionController.PerformAction(_actor.GetIdleAction());
break;
case ScnActorBehaviour.PathFollow:
_currentBehaviour = ScnActorBehaviour.PathFollow;
_actionController.PerformAction(_actor.GetIdleAction());
break;
}
}
if (_currentBehaviour == ScnActorBehaviour.PathFollow)
@@ -466,7 +466,7 @@ namespace Pal3.Actor
_tilemap.GetWorldPosition(position, _currentLayerIndex),
};
SetupPath(directWayPoints, mode, endOfPathAction, ignoreObstacle: true);
SetupPath(directWayPoints, mode, endOfPathAction, ignoreObstacle: true, specialAction);
}
else
{