Skip to content

Commit

Permalink
Merge pull request #39 from mhansen718/patch-1
Browse files Browse the repository at this point in the history
Fix SE life support integration
  • Loading branch information
Kiplacon authored Jan 13, 2023
2 parents a3c76aa + 7373ad4 commit b155388
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions script/MiscFunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ function SwapToGhost(player)
if (remote.interfaces.jetpack and remote.interfaces.jetpack.block_jetpack) then
remote.call("jetpack", "block_jetpack", {character=NEWHOST})
end
if (remote.interfaces["space-exploration"] and remote.interfaces["space-exploration"].on_character_swapped) then
remote.call("space-exploration", "on_character_swapped", {new_character=NEWHOST,old_character=OG})
end
zhonyas.set_driver(OG)
zhonyas.force = "enemy"
zhonyas.destructible = false
Expand Down Expand Up @@ -187,6 +190,10 @@ function SwapBackFromGhost(player, FlyingItem)
FlyingItem.SwapBack.health = OG2.health
FlyingItem.SwapBack.selected_gun_index = OG2.selected_gun_index
FlyingItem.player.character_running_speed_modifier = 0

if (remote.interfaces["space-exploration"] and remote.interfaces["space-exploration"].on_character_swapped) then
remote.call("space-exploration", "on_character_swapped", {new_character=FlyingItem.SwapBack,old_character=OG2})
end
OG2.destroy()
else
FlyingItem.SwapBack.destructible = true
Expand Down Expand Up @@ -250,13 +257,16 @@ function SwapBackFromGhost(player, FlyingItem)
spider.follow_target = PlayerProperties.SwapBack
end
end
PlayerProperties.SwapBack.destructible = true
PlayerProperties.SwapBack.health = OG2.health
PlayerProperties.SwapBack.selected_gun_index = OG2.selected_gun_index
player.character_running_speed_modifier = 0
OG2.destroy()
PlayerProperties.SwapBack.destructible = true
PlayerProperties.SwapBack.health = OG2.health
PlayerProperties.SwapBack.selected_gun_index = OG2.selected_gun_index
player.character_running_speed_modifier = 0
if (remote.interfaces["space-exploration"] and remote.interfaces["space-exploration"].on_character_swapped) then
remote.call("space-exploration", "on_character_swapped", {new_character=PlayerProperties.SwapBack,old_character=OG2})
end
OG2.destroy()
PlayerProperties.SwapBack = nil
end
end
end

function copy(object)
Expand Down

0 comments on commit b155388

Please sign in to comment.