Updates the current recipe, based on the current input
| 308 | |
| 309 | /// Updates the current recipe, based on the current input |
| 310 | void cFurnaceEntity::UpdateInput(void) |
| 311 | { |
| 312 | if (!m_Contents.GetSlot(fsInput).IsEqual(m_LastInput)) |
| 313 | { |
| 314 | // The input is different from what we had before, reset the cooking time |
| 315 | m_TimeCooked = 0; |
| 316 | } |
| 317 | m_LastInput = m_Contents.GetSlot(fsInput); |
| 318 | |
| 319 | cFurnaceRecipe * FR = cRoot::Get()->GetFurnaceRecipe(); |
| 320 | m_CurrentRecipe = FR->GetRecipeFrom(m_Contents.GetSlot(fsInput)); |
| 321 | if (!CanCookInputToOutput()) |
| 322 | { |
| 323 | // This input cannot be cooked |
| 324 | m_NeedCookTime = 0; |
| 325 | SetIsCooking(false); |
| 326 | } |
| 327 | else |
| 328 | { |
| 329 | m_NeedCookTime = m_CurrentRecipe->CookTime; |
| 330 | SetIsCooking(true); |
| 331 | |
| 332 | // Start burning new fuel if there's no flame now: |
| 333 | if (GetFuelBurnTimeLeft() <= 0) |
| 334 | { |
| 335 | BurnNewFuel(); |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | |
| 341 |
nothing calls this directly
no test coverage detected