diff options
author | cflip <cflip@cflip.net> | 2022-03-29 16:26:11 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-03-29 16:26:11 -0600 |
commit | 94212b5fda87b6983465103d6f35253c874a2915 (patch) | |
tree | d33aeb139ce6b9f2614b0c64dc5ee1514c781278 /src/main.cpp | |
parent | cacee6dfd972791996b3aae2a8ad4c733de6c05c (diff) |
Return a reference instead of a pointer in addVehicle()
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index b555aa5..dcd5975 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,9 +46,9 @@ int main(int argc, char** argv) int my = y / Scale + yOffs; auto pos = ScreenToTile({ mx, my }); - Train* train = level.addVehicle(); - train->setPosition(pos.x, pos.y); - train->setSpeed(0.2f); + Train& train = level.addVehicle(); + train.setPosition(pos.x, pos.y); + train.setSpeed(0.2f); } }); |