Unlinks target portal if it's linked to a different portal

This is effectively a missing part to the change that made locate_or_build_portal() enforce that portals only link together in mutual pairs. As target portals that didn't need to be located or built we not being updated to link back to where the player travelled from.

Also
* implements events: on_run_wormhole, on_extinguish
* adds a lot of debug info
This commit is contained in:
Treer
2019-07-17 23:07:05 +10:00
committed by SmallJoker
parent 6401052f92
commit 52b20925d5
2 changed files with 49 additions and 9 deletions

View File

@ -96,9 +96,13 @@ Used by `nether.register_portal`.
-- If orientation is not specified then the orientation of the realm
-- portal will be used.
on_run_wormhole,
on_ignite,
on_extinguish,
on_player_teleported,
on_created
on_run_wormhole = function(portalDef, anochorPos, orientation)
-- invoked once per second per portal
on_extinguish = function(portalDef, anochorPos, orientation)
-- invoked when a portal is extinguished, including when the portal
-- it connected to was extinguished.
todo: on_ignite = function(portalDef, anochorPos, orientation)
todo: on_player_teleported = function(portalDef, oldPos, newPos)
todo: on_created = function(portalDef, anochorPos, orientation)
}