Skip to content

Commit

Permalink
Added support for Event_onRelay
Browse files Browse the repository at this point in the history
Minor modifications
  • Loading branch information
McTwist committed Jan 24, 2018
1 parent 168b428 commit 1136d8a
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions server.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// ================
// Name :: FireRelayNum
// Version :: 7
// Version :: 8
// ================
// Made by :: McTwist
// Date :: 17-12-08
// Date :: 18-01-24
// Info :: Event that choose what onRelay to use
// License :: Free to use
// ================
Expand Down Expand Up @@ -66,21 +66,34 @@
if (%obj.eventInput[%i] !$= "onRelay")
continue;

// Target another brick
// Target brick(s)
if (%obj.eventTargetIdx[%i] == -1)
{
%type = "fxDTSBrick";
%group = getBrickGroupFromObject(%obj);
%name = %obj.eventNT[%i];
for (%bricks = 0; %bricks < %group.NTObjectCount[%name]; %bricks++)
%bricks[%bricks] = %group.NTObject[%name, %bricks];
for (%objs = 0; %objs < %group.NTObjectCount[%name]; %objs++)
%objs[%objs] = %group.NTObject[%name, %objs];
}
// Self
else
{
%type = inputEvent_GetTargetClass(%obj.getClassName(), %obj.eventInputIdx[%i], %obj.eventTargetIdx[%i]);
%bricks = 1;
%bricks[0] = %obj;
%objs = 1;
// Get object from type (Event_onRelay)
switch$ (%type)
{
case "Bot":
%objs0 = %obj.hBot;
case "Player":
%objs0 = %client.player;
case "GameConnection":
%objs0 = %client;
case "Minigame":
%objs0 = getMinigameFromObject(%client);
default:
%objs0 = %obj;
}
}

// Parameters
Expand All @@ -96,9 +109,12 @@
%param = %param @ ", " @ %client;

// Go through list/brick
for (%n = 0; %n < %bricks; %n++)
for (%n = 0; %n < %objs; %n++)
{
%next = %bricks[%n];
%next = %objs[%n];

if (!isObject(%next))
continue;

// Call for event function
// Note: There is no other feasible way to do this on
Expand All @@ -111,6 +127,7 @@
// Mark as processed
%tempEvent[%i] = 1;
}
return "";
}

// Events
Expand Down

0 comments on commit 1136d8a

Please sign in to comment.