refactor: simplify train debug logs to strings only
Changed from logging objects to simple string format:
- Before: { momentum: 50, trainPosition: 0, pressure: 60, ... }
- After: Sprint: momentum=50 pos=0 pressure=60
Issue identified from logs: trainPosition stuck at 0!
This is why train isn't appearing/moving.
This commit is contained in:
@@ -93,23 +93,8 @@ export function SteamTrainJourney({
|
||||
currentQuestion,
|
||||
currentInput,
|
||||
}: SteamTrainJourneyProps) {
|
||||
console.log('🚂 [SteamTrainJourney] Render:', {
|
||||
momentum,
|
||||
trainPosition,
|
||||
pressure,
|
||||
elapsedTime,
|
||||
currentQuestion,
|
||||
currentInput,
|
||||
})
|
||||
|
||||
const { state } = useComplementRace()
|
||||
console.log('🚂 [SteamTrainJourney] State from provider:', {
|
||||
stations: state.stations,
|
||||
passengers: state.passengers,
|
||||
currentRoute: state.currentRoute,
|
||||
gamePhase: state.gamePhase,
|
||||
isGameActive: state.isGameActive,
|
||||
})
|
||||
console.log(`🚂 Train: mom=${momentum} pos=${trainPosition} stations=${state.stations.length} passengers=${state.passengers.length}`)
|
||||
|
||||
const { getSkyGradient, getTimeOfDayPeriod } = useSteamJourney()
|
||||
const _skyGradient = getSkyGradient()
|
||||
|
||||
@@ -330,14 +330,7 @@ export function ComplementRaceProvider({ children }: { children: ReactNode }) {
|
||||
}
|
||||
}, [multiplayerState, localPlayerId, localUIState])
|
||||
|
||||
console.log('🚂 [Provider] Transformed sprint values:', {
|
||||
momentum: compatibleState.momentum,
|
||||
trainPosition: compatibleState.trainPosition,
|
||||
pressure: compatibleState.pressure,
|
||||
stations: compatibleState.stations?.length,
|
||||
passengers: compatibleState.passengers?.length,
|
||||
currentRoute: compatibleState.currentRoute,
|
||||
})
|
||||
console.log(`🚂 Sprint: momentum=${compatibleState.momentum} pos=${compatibleState.trainPosition} pressure=${compatibleState.pressure}`)
|
||||
|
||||
// Action creators
|
||||
const startGame = useCallback(() => {
|
||||
|
||||
Reference in New Issue
Block a user