Oops, fixed global variable references

This commit is contained in:
Erkki Seppälä 2014-10-22 21:52:30 +03:00
parent a2fcbfa7ec
commit 2ddead6962

View file

@ -215,13 +215,13 @@ Plane = Class{
shoot = function(self, down) shoot = function(self, down)
if self.health > 0 then if self.health > 0 then
if down then if down then
if not kbdShooting and not joyShooting then if not self.kbdShooting and not self.joyShooting then
self.machinegun:startShooting() self.machinegun:startShooting()
end end
kbdShooting = true self.kbdShooting = true
else else
kbdShooting = false self.kbdShooting = false
if not kbdShooting and not joyShooting then if not self.kbdShooting and not self.joyShooting then
self.machinegun:stopShooting() self.machinegun:stopShooting()
end end
end end
@ -473,13 +473,13 @@ Plane = Class{
self.brake = brake self.brake = brake
if fire then if fire then
if not kbdShooting and not joyShooting then if not self.kbdShooting and not self.joyShooting then
self.machinegun:startShooting() self.machinegun:startShooting()
end end
joyShooting = true self.joyShooting = true
else else
joyShooting = false self.joyShooting = false
if not kbdShooting and not joyShooting then if not self.kbdShooting and not self.joyShooting then
self.machinegun:stopShooting() self.machinegun:stopShooting()
end end
end end