From: <at...@us...> - 2010-01-16 18:53:11
|
Revision: 484 http://babbot.svn.sourceforge.net/babbot/?rev=484&view=rev Author: attn99 Date: 2010-01-16 18:53:05 +0000 (Sat, 16 Jan 2010) Log Message: ----------- Ignore player dead state when recording graveyard route Modified Paths: -------------- trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs Modified: trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs =================================================================== --- trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs 2010-01-16 18:51:37 UTC (rev 483) +++ trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs 2010-01-16 18:53:05 UTC (rev 484) @@ -107,7 +107,9 @@ ctrlRouteDetails.tbZoneA.Text = ProcessManager.Player.ZoneText; // Load RouteRecordingState and start - _route_rec_state = new RouteRecordingState(RecordWp, numRecDistance.Value); + _route_rec_state = new RouteRecordingState(RecordWp, + numRecDistance.Value, ((AbstractListEndpoint)ctrlRouteDetails. + cbTypeA.SelectedItem).EType == EndpointTypes.GRAVEYARD); ProcessManager.Player.StateMachine. InitState = new TestGlobalState(_route_rec_state); Modified: trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs 2010-01-16 18:51:37 UTC (rev 483) +++ trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs 2010-01-16 18:53:05 UTC (rev 484) @@ -36,12 +36,18 @@ private float _min_dist = 1; /// <summary> + /// Is recording done for dead state + /// </summary> + bool _dead_state; + + /// <summary> /// Class constructor /// </summary> /// <param name="WpRecordProc">Callback function on recording event</param> /// <param name="max_dist">Max distance between waypoints before fire recording event</param> - public RouteRecordingState(WaypointRecordingHandler WpRecordProc, decimal max_dist) + public RouteRecordingState(WaypointRecordingHandler WpRecordProc, decimal max_dist, bool dead_state) { + dead_state = _dead_state; _rec_dist = (float) max_dist; OnWaypointRecording = WpRecordProc; } @@ -66,7 +72,8 @@ /// <param name="player"></param> protected override void DoExecute(WowPlayer player) { - if (player.IsDead) + // Ignore dead if in deadstate + if (!_dead_state && player.IsDead) { Finish(player); return; @@ -91,25 +98,5 @@ OnWaypointRecording(_coord.CloneVector()); } } - - /// <summary> - /// Exit event handler - /// </summary> - /// <param name="Entity"></param> - protected override void DoExit(WowPlayer Entity) - { - //on exit we will do nothing - return; - } - - /// <summary> - /// Finish event handler - /// </summary> - /// <param name="Entity"></param> - protected override void DoFinish(WowPlayer Entity) - { - //on finish we will do nothing - return; - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |