level 5
qz12645
楼主
treenode item = parnode(1);
treenode current = ownerobject(c);
int port = parval(2);
/***popup:ConditionalTransport*/
/**条件运输*/
/** \n如果条件为真,则使用运输机,否则直接发送临时实体。*/
/** \n条件: */
int condition = port == 3;
/** \n运输机: */
treenode disp = /***tag:transport*//**/centerobject(current,1)/**/;
if(condition)
{
return tonum(disp);
}
else
{
transportoutcomplete(current, item, port);
transportincomplete(outobject(current, port), item, opipno(current, port));
moveobject(item, outobject(current, port), port);
}
1、我想请教一下前3行代码的意思
2、这句:int condition = port == 3; 是端口为3的时候起作用,现在我想设置为端口为1或3时起作用,整段代码需要怎么修改呢? 希望玩代码的大大们帮忙看下,多谢~
2017年12月05日 07点12分
1
treenode current = ownerobject(c);
int port = parval(2);
/***popup:ConditionalTransport*/
/**条件运输*/
/** \n如果条件为真,则使用运输机,否则直接发送临时实体。*/
/** \n条件: */
int condition = port == 3;
/** \n运输机: */
treenode disp = /***tag:transport*//**/centerobject(current,1)/**/;
if(condition)
{
return tonum(disp);
}
else
{
transportoutcomplete(current, item, port);
transportincomplete(outobject(current, port), item, opipno(current, port));
moveobject(item, outobject(current, port), port);
}
1、我想请教一下前3行代码的意思
2、这句:int condition = port == 3; 是端口为3的时候起作用,现在我想设置为端口为1或3时起作用,整段代码需要怎么修改呢? 希望玩代码的大大们帮忙看下,多谢~