Skip to content

Commit

Permalink
revision to cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kherae committed Dec 12, 2023
1 parent 0ff7a96 commit 3dedbe7
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions scripts/fumm_player_primary.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
require "/scripts/fumementomori.lua"

if not _mm_wrapped then
_applyDamageRequest = applyDamageRequest
_init = init
_update = update
_teleportOut = teleportOut
_mm_wrapped = true
end
local fummApplyDamageRequest = applyDamageRequest
local fummInit = init
local fummUpdate = update
local fummTeleportOut = teleportOut
local promise
local promise2
local mm_timer=5.0

function applyDamageRequest(damageRequest)
local r = _applyDamageRequest(damageRequest)
local r = fummApplyDamageRequest(damageRequest)
if (not playerIsAdmin) and next(r) ~= nil and r[1].hitType == "kill" and worldId then
status.setStatusProperty("fuEnhancerActive", false)
status.setStatusProperty(mementomori.deathPositionKey.."."..worldId,{position=mcontroller.position()})
Expand All @@ -18,12 +18,11 @@ function applyDamageRequest(damageRequest)
return r
end

function init()
mm_timer=5.0
_init()
function init(...)
if fummInit then fummInit(...) end
end

function update(dt)
function update(dt,...)
if not mm_timer then
mm_timer=0.0
elseif mm_timer > 5.0 then
Expand All @@ -47,10 +46,10 @@ function update(dt)
end
end
end
_update(dt)
if fummUpdate then fummUpdate(dt,...) end
end

function teleportOut(...)
mm_timer=0.0
_teleportOut(...)
if fummTeleportOut then fummTeleportOut(...) end
end

0 comments on commit 3dedbe7

Please sign in to comment.