File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,8 @@ export class Packet extends Graphics {
193193export function sendPacket (
194194 viewgraph : ViewGraph ,
195195 packetType : string ,
196- originId : number ,
197- destinationId : number ,
196+ originId : DeviceId ,
197+ destinationId : DeviceId ,
198198) {
199199 console . log (
200200 `Sending ${ packetType } packet from ${ originId } to ${ destinationId } ` ,
@@ -233,5 +233,11 @@ export function sendPacket(
233233 console . warn ( `No se encontró un dispositivo con ID ${ originId } .` ) ;
234234 return ;
235235 }
236- packet . traverseEdge ( originConnections [ 0 ] , originId ) ;
236+ let firstEdge = originConnections . find ( ( edge ) => {
237+ return edge . otherEnd ( originId ) === destinationId ;
238+ } ) ;
239+ if ( firstEdge === undefined ) {
240+ firstEdge = originConnections [ 0 ] ;
241+ }
242+ packet . traverseEdge ( firstEdge , originId ) ;
237243}
You can’t perform that action at this time.
0 commit comments