File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 2828 {
2929 "major":0,
3030 "minor":1,
31- "patch":0
31+ "patch":1
3232 }
3333}
Original file line number Diff line number Diff line change 33 "name" : " Automatic Orders" ,
44 "author" : " Blothorn" ,
55 "utility" : " true" ,
6- "version" : " 0.1.0 " ,
6+ "version" : " 0.1.1 " ,
77 "description" : " Automatically issues retreat orders to damaged or low-PPT ships (as configured in its settings file)" ,
88 "gameVersion" : " 0.9a" ,
99 "jars" :[" automaticorders.jar" ],
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ private enum class RetreatReason {
2222private data class SetKey (val id : String , val reason : RetreatReason )
2323
2424class AutomaticOrdersCombatPlugin : BaseEveryFrameCombatPlugin () {
25- private lateinit var engine: CombatEngineAPI
25+ private var engine: CombatEngineAPI ? = null
2626 private lateinit var fleetManager: CombatFleetManagerAPI
2727 private lateinit var taskManager: CombatTaskManagerAPI
2828
@@ -35,15 +35,17 @@ class AutomaticOrdersCombatPlugin : BaseEveryFrameCombatPlugin() {
3535 val LOGGER = Global .getLogger(AutomaticOrdersCombatPlugin ::class .java)
3636 }
3737
38- override fun init (engine : CombatEngineAPI ) {
38+ override fun init (engine : CombatEngineAPI ? ) {
39+ if (engine == null ) return
3940 this .engine = engine
4041 this .fleetManager = engine.getFleetManager(FleetSide .PLAYER )
4142 this .taskManager = fleetManager.getTaskManager(false )
4243 }
4344
4445 override fun advance (amount : Float , events : List <InputEventAPI >? ) {
45- if (Global .getCurrentState() == GameState .TITLE ) return
46- if (Global .getCurrentState() == GameState .CAMPAIGN ) return
46+ if (Global .getCurrentState() != GameState .COMBAT ) return
47+ val engine = this .engine
48+ if (engine == null ) return
4749 if (engine.isSimulation) return
4850
4951 interval.advance(amount)
You can’t perform that action at this time.
0 commit comments