diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2024-10-15 13:09:43 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-15 13:09:43 -0600 |
| commit | a0862b6a159373f2e1554e489ecb5bb08d89654e (patch) | |
| tree | b5c33fc7f65b438ee74898dd9ed7ba25b0fa108a /src/engine/Cup.cpp | |
| parent | 58d56fcba848e8545052c1d85ef27d0b02841538 (diff) | |
[modding] Implement Vehicles & Fix Animations (#109)
* Train works
* Fix minimap
* Fix highway
* Fix
* Refactor train and boat
* Update
* Implement Trucks
* Fix tanker
* Finish implementing vehicles
* Fix animations
* Fix spawn players
* Fix spawn players
* Fix loading custom data
---------
Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine/Cup.cpp')
| -rw-r--r-- | src/engine/Cup.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/engine/Cup.cpp b/src/engine/Cup.cpp index 0e77ac9b8..edbc0ebbd 100644 --- a/src/engine/Cup.cpp +++ b/src/engine/Cup.cpp @@ -22,6 +22,13 @@ void Cup::Previous() { } } +void Cup::SetCourse(size_t position) { + if ((position < 0) || (position >= Courses.size())) { + throw std::invalid_argument("Invalid course index."); + } + CursorPosition = position; +} + Course* Cup::GetCourse() { return Courses[CursorPosition]; } |
