From b1c5ac236d08910646280cc717408067fbe8e630 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Thu, 19 Oct 2023 16:46:52 +0800 Subject: [PATCH] light sys --- sys/device_sys/light.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/device_sys/light.go b/sys/device_sys/light.go index 2d54fa1..a5de142 100644 --- a/sys/device_sys/light.go +++ b/sys/device_sys/light.go @@ -22,11 +22,7 @@ func (ls *LightSys) Update(w ecs.World) { //灯当前状态,true-灯丝有电流,false-灯丝没有电流 state := component.BitStateType.Get(entry) //驱动灯亮或灭 - if drive.Td != state.Val { - state.Val = drive.Td - } - //故障设置 - state.Val = state.Val && !ls.calculateFault(entry) + state.Val = drive.Td && !ls.calculateFault(entry) }) } func (ls *LightSys) calculateFault(entry *ecs.Entry) bool {