From d15b1cbc515362dbf5ed6700910b80aef23bd268 Mon Sep 17 00:00:00 2001 From: Redo Date: Fri, 28 Oct 2022 16:00:58 -0600 Subject: [PATCH] robot debug 2 --- bricks/special/robot.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/bricks/special/robot.cs b/bricks/special/robot.cs index 78c92bf..0abfe85 100644 --- a/bricks/special/robot.cs +++ b/bricks/special/robot.cs @@ -242,24 +242,17 @@ function LogicGate_RobotController_Data::createRobot(%this, %obj) { %obj.luaLogicRobot = %robot; - lualogic_sendinput(%obj, 1, "P" @ %rpos SPC %obj.getAngleId()); + schedule(1000, 0, lualogic_sendinput, %obj, 1, "P" @ %rpos SPC %obj.getAngleId()); } -function LogicGate_RobotController_Data::onDeath(%this, %obj) { +function LogicGate_RobotController_Data::Logic_onRemove(%this, %obj) { + talk("robot remove"); if(isObject(%obj.luaLogicRobot)) %obj.luaLogicRobot.delete(); } -function LogicGate_RobotController_Data::onRemove(%this, %obj) { - if(isObject(%obj.luaLogicRobot)) - %obj.luaLogicRobot.delete(); -} - -function LogicGate_RobotController_Data::onPlant(%this, %obj) { - if(!isObject(%obj.luaLogicRobot)) - %this.createRobot(%obj); -} -function LogicGate_RobotController_Data::onLoadPlant(%this, %obj) { +function LogicGate_RobotController_Data::Logic_onPlant(%this, %obj) { + talk("robot plant"); if(!isObject(%obj.luaLogicRobot)) %this.createRobot(%obj); }