Buggy code:
if ( ( ( ! ( target . isInClearing ( ) ) ) || ( ! ( target . clearing . isCave ( ) ) ) ) && ( ! ( target . clearing . holdsDwelling ( ) ) ) ) { willBeOutside = true ; } } if ( valid ) { if ( ( isInCave || ( ar . willMoveToCave ( ) ) ) && ( ( phaseManager . hasUsedSunlight ( ) ) || ( phaseManager . willRequireSunlight ( ar . getAction ( ) ) ) ) ) { if ( fromPlayAll ) { JOptionPane . showMessageDialog ( this , ( ( "The<seq2seq4repair_space>next<seq2seq4repair_space>action<seq2seq4repair_space>(" + ( ar . getAction ( ) ) ) + ")<seq2seq4repair_space>is<seq2seq4repair_space>currently<seq2seq4repair_space>invalid.<seq2seq4repair_space>Press<seq2seq4repair_space>\"Play<seq2seq4repair_space>Next\"<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>when<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>ready." ) , "Invalid<seq2seq4repair_space>Phase" , JOptionPane . WARNING_MESSAGE ) ; return false ; } ar . makeBlankPhase ( "No<seq2seq4repair_space>sunlight<seq2seq4repair_space>phases<seq2seq4repair_space>in<seq2seq4repair_space>caves!" ) ; } else if ( ( isOutside || willBeOutside ) && ( phaseManager . hasUsedSheltered ( ) ) ) { if ( fromPlayAll ) { JOptionPane . showMessageDialog ( this , ( ( "The<seq2seq4repair_space>next<seq2seq4repair_space>action<seq2seq4repair_space>(" + ( ar . getAction ( ) ) ) + ")<seq2seq4repair_space>is<seq2seq4repair_space>currently<seq2seq4repair_space>invalid.<seq2seq4repair_space>Press<seq2seq4repair_space>\"Play<seq2seq4repair_space>Next\"<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>when<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>ready." ) , "Invalid<seq2seq4repair_space>Phase" , JOptionPane . WARNING_MESSAGE ) ; return false ; } ar . makeBlankPhase ( "No<seq2seq4repair_space>outdoor<seq2seq4repair_space>phases<seq2seq4repair_space>allowed<seq2seq4repair_space>after<seq2seq4repair_space>sheltered!" ) ; } else { if ( phaseManager . canAddAction ( ar . getAction ( ) , pony , getGameHandler ( ) . getMainFrame ( ) ) ) { requiredObject = phaseManager . getNextRequiredObject ( ar . getAction ( ) , pony ) ; int count = ar . getCount ( ) ; int allowed = phaseManager . getNumberOfActionsAllowed ( ar . getAction ( ) , pony ) ; if ( ( allowed > 0 ) && ( ( ar . willHavePhaseEndUpdates ( ) ) || ( calendar . isFatiguePhasesType ( month ) ) ) ) { allowed = 1 ; } if ( allowed < count ) { ar . setCount ( allowed ) ; ActionRow newAction = ar . makeCopy ( ) ; newAction . setCount ( ( count - allowed ) ) ; actionRows . add ( afterRowIndex , newAction ) ; model . fireTableDataChanged ( ) ; } } else if ( ! ( current . isBetweenClearings ( ) ) ) { if ( fromPlayAll ) { JOptionPane . showMessageDialog ( this , ( ( "The<seq2seq4repair_space>next<seq2seq4repair_space>action<seq2seq4repair_space>(" + ( ar . getAction ( ) ) ) + ")<seq2seq4repair_space>is<seq2seq4repair_space>currently<seq2seq4repair_space>invalid.<seq2seq4repair_space>Press<seq2seq4repair_space>\"Play<seq2seq4repair_space>Next\"<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>when<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>ready." ) , "Invalid<seq2seq4repair_space>Phase" , JOptionPane . WARNING_MESSAGE ) ; return false ; } ar . makeInvalidPhase ( ) ; } } } else { if ( fromPlayAll ) { JOptionPane . showMessageDialog ( this , ( ( "The<seq2seq4repair_space>next<seq2seq4repair_space>action<seq2seq4repair_space>(" + ( ar . getAction ( ) ) ) + ")<seq2seq4repair_space>is<seq2seq4repair_space>currently<seq2seq4repair_space>invalid.<seq2seq4repair_space>Press<seq2seq4repair_space>\"Play<seq2seq4repair_space>Next\"<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>when<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>ready." ) , "Invalid<seq2seq4repair_space>Phase" , JOptionPane . WARNING_MESSAGE ) ; return false ; } ar . makeBlankPhase ( "Invalid<seq2seq4repair_space>phase!" ) ; } } TileLocation locationBeforeAction = getCharacter ( ) . getCurrentLocation ( ) ; ar . process ( ) ; if ( ( fromPlayAll && ( ar . isCancelled ( ) ) ) && ( ( ar . getActionId ( ) ) == ( ActionId . Move ) ) ) { ar . setResult ( "" ) ; ar . setCancelled ( false ) ; ar . setCompleted ( false ) ; JOptionPane . showMessageDialog ( this , ( ( "The<seq2seq4repair_space>next<seq2seq4repair_space>action<seq2seq4repair_space>(" + ( ar . getAction ( ) ) ) + ")<seq2seq4repair_space>is<seq2seq4repair_space>currently<seq2seq4repair_space>invalid.<seq2seq4repair_space>Press<seq2seq4repair_space>\"Play<seq2seq4repair_space>Next\"<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>when<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>ready." ) , "Invalid<seq2seq4repair_space>Phase" , JOptionPane . WARNING_MESSAGE ) ; return false ; } TileLocation locationAfterAction = getCharacter ( ) . getCurrentLocation ( ) ; if ( ( ar . isCompleted ( ) ) && ( calendar . hasSpecial ( month ) ) ) { if ( calendar . isFatiguePhasesOutside ( month ) ) { if ( ! ( locationAfterAction . isInside ( hostPrefs . hasPref ( HOUSE2_RED_SPECIAL_SHELTER ) ) ) ) { getCharacter ( ) . setWeatherFatigue ( ( ( ar . getPhaseCount ( ) ) * ( ar . getCount ( ) ) ) ) ; } } if ( calendar . isFatiguePhasesMountain ( month ) ) { if ( ( locationAfterAction . isInClearing ( ) ) && ( locationAfterAction . clearing . isMountain ( ) ) ) { getCharacter ( ) . setWeatherFatigue ( ( ( ar . getPhaseCount ( ) ) * ( ar . getCount ( ) ) ) ) ; } } getCharacterFrame ( ) . fatigueToContinue ( ) ; } <START_BUG> if ( ! ( locationAfterAction . isInside ( false ) ) ) { <END_BUG> CharacterWrapper character = getCharacter ( ) ; ArrayList < SpellWrapper > spellsEndInSunlight = SpellUtility . getBewitchingSpellsWithKey ( character . getGameObject ( ) , "ends_in_sunlight" ) ; for ( SpellWrapper ending : spellsEndInSunlight ) { ending . expireSpell ( ) ; } } updateNextPendingAction ( ) ; getCharacterFrame ( ) . updateCharacter ( ) ; QuestRequirementParams params = new QuestRequirementParams ( ) ; params . timeOfCall = GamePhaseType . EndOfPhase ; if ( getCharacter ( ) . testQuestRequirements ( getMainFrame ( ) , params ) ) { getCharacterFrame ( ) . updateCharacter ( ) ; } getGameHandler ( ) . submitChanges ( ) ; actionTable . repaint ( ) ; if ( ! ( ar . isPending ( ) ) ) { DieRoller monsterDieRoller = game . getMonsterDie ( ) ; for ( CharacterWrapper follower : getCharacter ( ) . getStoppedActionFollowers ( ) ) { getCharacter ( ) . removeActionFollower ( follower , monsterDieRoller ) ; } ArrayList < ActionRow > newActions = new ArrayList < ActionRow > ( ) ; ActionRow newAction = ar . getNewAction ( ) ; while ( newAction != null ) { newAction . setSpawned ( true ) ; newAction . logAction ( ) ; newActions . add ( newAction ) ; newAction = newAction . getNewAction ( ) ; } if ( ! ( newActions . isEmpty ( ) ) ) { actionRows . addAll ( afterRowIndex , newActions ) ; model . fireTableDataChanged ( ) ; } ArrayList se = getCharacter ( ) . getSpellExtras ( ) ;

Fix:
if ( ! ( locationAfterAction . isCave ( ) ) ) {