[Fix] Add the actuall cfg id to client send EVENT_AVATAR_NEAR_PLATFORM events (thx @scooterboo )

This commit is contained in:
hartie95 2023-10-04 01:00:35 +02:00
parent 78bb2510a7
commit ac8c6848c9

View File

@ -5,6 +5,7 @@ import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ClientScriptEventNotifyOuterClass.ClientScriptEventNotify; import emu.grasscutter.net.proto.ClientScriptEventNotifyOuterClass.ClientScriptEventNotify;
import emu.grasscutter.scripts.constants.EventType;
import emu.grasscutter.scripts.data.ScriptArgs; import emu.grasscutter.scripts.data.ScriptArgs;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
import lombok.val; import lombok.val;
@ -28,6 +29,12 @@ public class HandlerClientScriptEventNotify extends PacketHandler {
case 2 -> args.setParam3(data.getParamList(i)); case 2 -> args.setParam3(data.getParamList(i));
} }
} }
if(data.getEventType() == EventType.EVENT_AVATAR_NEAR_PLATFORM){
val entity = scriptManager.getScene().getEntityById(data.getSourceEntityId());
if(entity != null){
args.setParam1(entity.getConfigId());
}
}
scriptManager.callEvent(args); scriptManager.callEvent(args);
} }