allow flying karl as notplayer, dont tether instantly if you/host was notplayer then revived

This commit is contained in:
bgkillas 2024-10-07 07:57:10 -04:00
parent ed4ba25283
commit 7e1c264c3d
2 changed files with 8 additions and 2 deletions

View file

@ -56,7 +56,9 @@ edit_component( entity_id, "VelocityComponent", function(comp,vars)
local vx = 0
local vy = 0
local controls_comp = EntityGetFirstComponent(player, "ControlsComponent")
local is_thrusting = controls_comp ~= nil and ComponentGetValue2( controls_comp, "mButtonDownFly")
local is_dead = EntityHasTag(player, "ew_notplayer")
local is_thrusting = (not is_dead and controls_comp ~= nil and ComponentGetValue2( controls_comp, "mButtonDownFly"))
or (is_dead and (InputIsKeyJustDown(44) or InputIsJoystickButtonJustDown(0, 23)))
if is_thrusting then
vx = speed
vx, vy = vec_rotate(vx, vy, dir)