1
0
mirror of https://github.com/mt-mods/hangglider.git synced 2024-11-16 15:30:40 +01:00

rename can_fly() to friendly_airspace()

The name confused me over and over again. The function doesn't check flight-ability at all, it rather checks permission / friendlyness of area.

safe_node_below() does more of what 'can_fly' implies.
This commit is contained in:
Luke aka SwissalpS 2024-04-11 06:47:13 +02:00 committed by GitHub
parent 0872a9161f
commit 10d082c3bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,7 +84,7 @@ function hangglider.allowed_to_fly(pos, name, in_flight) --luacheck: no unused a
return true
end
local function can_fly(pos, name)
local function friendly_airspace(pos, name)
if not enable_flak then
return true
end
@ -153,7 +153,7 @@ local function hangglider_step(self, dtime)
})
end
end
if not can_fly(pos, name) then
if not friendly_airspace(pos, name) then
if not self.flak_timer then
self.flak_timer = 0
shoot_flak_sound(pos)