MEDIUM severity: When the oracle fails, the `gm` function incorrectly adjusts the `caseId` and temperature in the `We. When the oracle fails, the `gm` function incorrectly adjusts the `caseId` and temperature in the `Weather.sol` contract. This occurs when the `deltaB` value returned by the oracle is zero, causing the calculation of `caseId` to default to `3` and the temperature to be set incorrectly.\n\nThe `update...

Vulnerable code:
```\nfunction updateTemperature(int8 bT, uint256 caseId) private {\n    uint256 t = s.w.t;\n    if (bT < 0) {\n        if (t <= uint256(-bT)) {\n            bT = 1 - int8(t);\n            s.w.t = 1;\n        } else {\n            s.w.t = uint32(t - uint256(-bT));\n        }\n    } else {\n        s.w.t = uint32(t + uint256(bT));\n    }\n\n    emit TemperatureChange(s.season.current, caseId, bT);\n}\n```\n```\nfunction gm(address account, LibTransfer.To mode) public payable returns (uint256) {\n    int256 deltaB = stepOracle();  // @audit here if oracle failed, we update the season.timestamp and return deltaB zero here\n    uint256 caseId = calcCaseIdandUpdate(deltaB);  // @audit caseId will be 3 here if deltaB is zero\n    LibGerminate.endTotalGermination(season, LibWhitelistedTokens.getWhitelistedTokens());\n    LibGauge.stepGauge();\n    stepSun(deltaB, caseId);  // @audit wrong deltaB and caseId used here, setting the abovePeg to false and soil to zero\n}\n```\n```\npragma solidity ^0.7.6;\npragma abicoder v2;\n\nimport { Sun } from "contracts/beanstalk/sun/SeasonFacet/Sun.sol";\nimport { MockSeasonFacet } from "contracts/mocks/mockFacets/MockSeasonFacet.sol";\nimport { MockSiloFacet } from "contracts/mocks/mockFacets/MockSiloFacet.sol";\nimport { MockFieldFacet } from "contracts/mocks/mockFacets/MockFieldFacet.sol";\nimport { MockWhitelistFacet } from "contracts/mocks/mockFacets/MockWhitelistFacet.sol";\nimport { LibWhitelist } from "contracts/libraries/Silo/LibWhitelist.sol";\nimport { Utils } from "./utils/Utils.sol";\nimport "./utils/TestHelper.sol";\nimport "contracts/libraries/LibSafeMath32.sol";\nimport "contracts/C.sol";\n\ncontract SeasonTemperatureTest is MockSeasonFacet, TestHelper {\n    using SafeMath for uint256;\n    using LibSafeMath32 for uint32;\n\n    bool oracleFailed;\n\n    function setUp() public {\n        console.log("diamondSetup");\n        vm.createSelectFork('local');\n        oracleFailed = false;\n        setupDiamond();\n        dewhitelistCurvePool();\n        mintUnripeLPToUser1();\n        mintUnripeBeanToUser1();\n        setOraclePrices(false, 1000e6, 1000e6, 1000e6);\n        _setReservesForWell(1000000e6, 1000e18);\n\n        // user / tokens\n        mintTokenForUsers();\n        setTokenApprovalForUsers();\n\n        enableFertilizerAndMintActiveFertilizers();\n\n        callSunriseForUser1();\n    }\n\n    // Setup functions\n\n    function setTokenApprovalForUsers() internal {\n        approveTokensForUser(deployer);\n        approveTokensForUser(user1);\n        approveTokensForUser(user2);\n        approveTokensForUser(user3);\n        approveTokensForUser(user4);\n        approveTokensForUser(user5);\n    }\n\n    function mintTokenForUsers() internal {\n        mintWETHtoUser(deployer);\n        mintWETHtoUser(user1);\n        mintWETHtoUser(user2);\n        mintWETHtoUser(user3);\n        mintWETHtoUser(user4);\n        mintWETHtoUser(user5);\n\n        // mint C.bean() to users\n        C.bean().mint(deployer,\n```\n```\nhandleRain caseId: 0\n------------ Results --------------\n\nthisSowTime: 4294967295\nlastSowTime: 4294967295\ngetUsdTokenPrice: 1\ngetReserve0: 1\ngetReserve1: 1\ngetAbovePeg: false\ngetSoil: 462832752243\nlastDSoil: 0\ns.w.t: 5\nremaining pods: 467461079765\n\nhandleRain caseId: 3\nOracle failed, see results\n------------ Results --------------\n\nthisSowTime: 4294967295\nlastSowTime: 4294967295\ngetUsdTokenPrice: 1\ngetReserve0: 1\ngetReserve1: 1\ngetAbovePeg: false\ngetSoil: 0\nlastDSoil: 0\ns.w.t: 1\nremaining pods: 0\n\nSuite result: ok. 1 passed; 0 failed; 0 skipped; finished in 29.45s (3.32ms CPU time)\n```