Fixed both Pilot and Empath reset commands. They now follow the same
coding standards as the rest of the various commands (such as only
updating variables from the callers).
This commit is contained in:
Zach Dziura 2016-02-09 09:45:38 -05:00
parent f3d2c96f36
commit 7c8d07f839

View file

@ -2202,7 +2202,10 @@ dmsg(&quot;Autopilot path set up.&quot;)</script>
<Alias isActive="yes" isFolder="no"> <Alias isActive="yes" isFolder="no">
<name>Reset</name> <name>Reset</name>
<script>if #matches &gt; 1 then <script>if #matches &gt; 1 then
dreadnought.pilot.reset() local resets = dreadnought.reset.pilot()
dreadnought.aetherbeastsTotal = resets.aetherbeastsTotal
dreadnought.pilot = resets.pilot
dmsg(&quot;All pilot variables have been reset.&quot;) dmsg(&quot;All pilot variables have been reset.&quot;)
else else
dmsg(&quot;This will reset ALL piloting variables. Please type 'preset confirm' to confirm.&quot;) dmsg(&quot;This will reset ALL piloting variables. Please type 'preset confirm' to confirm.&quot;)
@ -2405,7 +2408,10 @@ dreadnought.repairShip()</script>
<Alias isActive="yes" isFolder="no"> <Alias isActive="yes" isFolder="no">
<name>Reset</name> <name>Reset</name>
<script>if #matches &gt; 1 then <script>if #matches &gt; 1 then
dreadnought.empath.reset() local resets = dreadnought.reset.empath()
dreadnought.aetherbeastsTotal = resets.aetherbeastsTotal
dreadnought.empath = resets.empath
dmsg(&quot;All empath variables have been reset.&quot;) dmsg(&quot;All empath variables have been reset.&quot;)
else else
dmsg(&quot;This will reset ALL empathing variables. Please type 'greset confirm' to confirm.&quot;) dmsg(&quot;This will reset ALL empathing variables. Please type 'greset confirm' to confirm.&quot;)
@ -2642,33 +2648,25 @@ dmsg(&quot;All Dreadnought reflexes have been disabled.&quot;)</script>
siphonCallout = false siphonCallout = false
}, },
paths = {}, paths = {}
reset = function ()
dreadnought.aetherbeastsTotal = 0
dreadnought.pilot.calloutTimer = 0
dreadnought.pilot.aetherbeastsPresent = 0
dreadnought.pilot.currentPosition = 1
dreadnought.pilot.flags = {
shocked = false,
siphonCallout = false
}
dreadnought.pilot.paths = {}
end
} }
function dreadnought.reset.pilot() function dreadnought.reset.pilot()
dreadnought.aetherbeastsTotal = 0 return {
dreadnought.pilot.calloutTimer = 0 aetherbeastsTotal = 0,
dreadnought.pilot.aetherbeastsPresent = 0
dreadnought.pilot.currentPosition = 1
dreadnought.pilot.flags = {
shocked = false,
siphonCallout = false
}
dreadnought.pilot.paths = {} pilot = {
calloutTimer = 0,
aetherbeastsPresent = 0,
currentPosition = 1,
flags = {
shocked = false,
siphonCallout = false
},
paths = {}
}
}
end</script> end</script>
<eventHandlerList/> <eventHandlerList/>
<Script isActive="yes" isFolder="no"> <Script isActive="yes" isFolder="no">
@ -2771,28 +2769,33 @@ end</script>
haveClarity = false haveClarity = false
}, },
slivvensFound = 0, slivvensFound = 0
}
reset = function () function dreadnought.reset.empath()
dreadnought.aetherbeastsTotal = 0 return {
dreadnought.empath.modules = { aetherbeastsTotal = 0,
chair = &quot;&quot;,
grid = &quot;&quot;, empath = {
turrets = {}, modules = {
collectors = {}, chair = &quot;&quot;,
orb = &quot;&quot;, grid = &quot;&quot;,
cube = &quot;&quot; turrets = {},
collectors = {},
orb = &quot;&quot;,
cube = &quot;&quot;
},
commands = heap.new(),
flags = {
haveClarity = false
},
slivvensFound = 0
} }
}
dreadnought.empath.commands = heap.new() end</script>
dreadnought.empath.flags = {
haveClarity = false
}
dreadnought.empath.slivvensFound = 0
end
}</script>
<eventHandlerList/> <eventHandlerList/>
<Script isActive="yes" isFolder="no"> <Script isActive="yes" isFolder="no">
<name>Repair Ship</name> <name>Repair Ship</name>