Skip to content

Commit 819390f

Browse files
committed
Update APGameState.hx
1 parent 972cdb6 commit 819390f

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

source/archipelago/APGameState.hx

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,10 +760,21 @@ class APGameState
760760
return _ap;
761761
}
762762

763+
var trapLink:Dynamic = null;
764+
763765
function bouncy(data:Dynamic)
764766
{
765767
trace("Bounce packet received: " + haxe.Json.stringify(data));
766-
768+
769+
// Check for TrapLink packet first
770+
if (Reflect.hasField(data, "trap_name"))
771+
{
772+
trapLink = data;
773+
trace("TrapLink packet received: " + haxe.Json.stringify(trapLink));
774+
// doTrapLink();
775+
return;
776+
}
777+
767778
if ((Reflect.hasField(data, "source") && Reflect.hasField(data, "time"))
768779
&& !APPlayState.deathByLink)
769780
{
@@ -784,6 +795,29 @@ class APGameState
784795
}
785796
}
786797

798+
// function doTrapLink()
799+
// {
800+
// if (trapLink == null)
801+
// {
802+
// trace("No trap link to process.");
803+
// return;
804+
// }
805+
806+
// var trapName = trapLink.trap_name;
807+
// var trapData = APItem.getTrapData(trapName);
808+
// if (trapData != null)
809+
// {
810+
// trace("Processing trap link: " + trapName);
811+
// APItem.doTrapLink(trapData, trapLink);
812+
// trapLink = null; // Clear the trap link after processing
813+
// }
814+
// else
815+
// {
816+
// trace("Trap data not found for: " + trapName);
817+
// trapLink = null; // Clear the trap link if no data found
818+
// }
819+
// }
820+
787821
function onSlotConnected(slotData:Dynamic)
788822
{
789823
if (backend.ClientPrefs.data.deathlink)

0 commit comments

Comments
 (0)