Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
- add support for Interface inheritance

- minor cleanup
  • Loading branch information
Lojemiru committed Sep 16, 2021
1 parent 7fe7878 commit 04ee2c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/LojHadronCollider/LojHadronCollider.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#macro __LHC_VERSION "v1.1.0"
#macro __LHC_VERSION "v1.1.1"
#macro __LHC_PREFIX "[Loj Hadron Collider]"
#macro __LHC_SOURCE "https://github.com/Lojemiru/Loj-Hadron-Collider"
#macro __LHC_EVENT "__lhc_event_"
Expand Down Expand Up @@ -86,6 +86,8 @@ function lhc_create_interface(_name) {
///@desc Inherits the function headers of the given interface.
///@param interface The name of the interface to inherit from.
function lhc_inherit_interface(_interface) {
if (!asset_has_tags(object_index, _interface, asset_object)) asset_add_tags(object_index, _interface, asset_object);

// Loop over global interface struct for name value, set local variables of the index name to an empty function.
var i = 0;
repeat (array_length(global.__lhc_interfaces[$ _interface])) {
Expand Down Expand Up @@ -198,7 +200,7 @@ function __lhc_check(_x, _y) {
j = 0;
// Scan through Interfaces and run relevant events.
repeat (__lhc_intLen) {
if (asset_has_tags(col.object_index, __lhc_interfaces[j], asset_object)) {
if (asset_has_tags(col, __lhc_interfaces[j], asset_object)) {
variable_instance_get(id, __LHC_EVENT + __lhc_interfaces[j])();
}
++j;
Expand Down

0 comments on commit 04ee2c9

Please sign in to comment.