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 {