修改继电器接口bug

This commit is contained in:
walker 2023-10-08 10:26:24 +08:00
parent 6a6d0657ca
commit 6444007ba2

View File

@ -49,18 +49,16 @@ func DriveRelayUp(w ecs.World, id string) {
// 驱动继电器到落下位置
func DriveRelayDown(w ecs.World, id string) {
w.Execute(func() {
w.Execute(func() {
wd := entity.GetWorldData(w)
entry, ok := wd.EntityMap[id]
if ok {
if entry.HasComponent(component.YjRelayTag) {
driveYjRelay(w, entry, true, false)
} else {
driveWjRelay(w, entry, false)
}
wd := entity.GetWorldData(w)
entry, ok := wd.EntityMap[id]
if ok {
if entry.HasComponent(component.YjRelayTag) {
driveYjRelay(w, entry, true, false)
} else {
fmt.Printf("未找到id=%s的继电器\n", id)
driveWjRelay(w, entry, false)
}
})
} else {
fmt.Printf("未找到id=%s的继电器\n", id)
}
})
}