修改采集信息panic

This commit is contained in:
walker 2024-01-18 14:54:39 +08:00
parent 1237abc9e9
commit 88e9482326
1 changed files with 6 additions and 2 deletions

View File

@ -240,7 +240,9 @@ func handlerSignalState(w ecs.World, uid string) (*state_proto.SignalState, erro
signalState.Aspect = state_proto.Signal_A
}
}
if entry.HasComponent(appcomponent.SignalParamType) {
signalState.Param = appcomponent.SignalParamType.Get(entry)
}
if entry.HasComponent(component.Signal2XH1ElectronicType) { // 2XH1信号机
signal2XH1 := component.Signal2XH1ElectronicType.Get(entry)
signalState.RelayStateMap = make(map[string]bool, 3)
@ -387,7 +389,9 @@ func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state_p
Dw: pos.Dw,
Fw: pos.Fw,
}
if entry.HasComponent(appcomponent.PointsParamType) {
s.Param = appcomponent.PointsParamType.Get(entry)
}
// // 强制(联锁驱动无效)
// s.Force = entry.HasComponent(component.TurnoutFaultCiqdType)
// // 失表