* Updates various peep stats upon entering a ride, as well as updating the * ride's satisfaction value. * rct2: 0x0069545B */
| 1770 | * rct2: 0x0069545B |
| 1771 | */ |
| 1772 | void Guest::onEnterRide(Ride& ride) |
| 1773 | { |
| 1774 | // Calculate how satisfying the ride is for the peep. Can range from -140 to +105. |
| 1775 | int16_t satisfaction = GuestCalculateRideSatisfaction(*this, ride); |
| 1776 | |
| 1777 | // Update the satisfaction stat of the ride. |
| 1778 | uint8_t rideSatisfaction = 0; |
| 1779 | if (satisfaction >= 40) |
| 1780 | rideSatisfaction = 3; |
| 1781 | else if (satisfaction >= 20) |
| 1782 | rideSatisfaction = 2; |
| 1783 | else if (satisfaction >= 0) |
| 1784 | rideSatisfaction = 1; |
| 1785 | |
| 1786 | ride.updateSatisfaction(rideSatisfaction); |
| 1787 | |
| 1788 | // Update various peep stats. |
| 1789 | if (guestNumRides < 255) |
| 1790 | guestNumRides++; |
| 1791 | |
| 1792 | setHasRidden(ride); |
| 1793 | GuestUpdateFavouriteRide(*this, ride, satisfaction); |
| 1794 | happinessTarget = std::clamp(happinessTarget + satisfaction, 0, kPeepMaxHappiness); |
| 1795 | GuestUpdateRideNauseaGrowth(*this, ride); |
| 1796 | } |
| 1797 | |
| 1798 | /** |
| 1799 | * |
no test coverage detected