Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Client/runtime/animation/animation_orders_tick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ void tick_animation_orders(const Frame& frame) {
// with them. In the third person their view goes round the body from behind.
// Not while the game's photo mode (F1) is open: its camera flies, ours held it at the eyes.
const bool photo_mode = kcds::runtime::camera::photo_mode_open();
const bool seat_look = kcds::runtime::carts::placed::local_held() && !photo_mode;
// The look stays through the climb down: the game's own view of a driver climbing off looked
// straight up until the clip ended.
const bool seat_look = (kcds::runtime::carts::placed::local_held() ||
kcds::runtime::carts::placed::local_climbing_off()) &&
!photo_mode;
// A scripted shot and NoClip have the camera to themselves meanwhile.
const bool camera_taken = kcds::runtime::camera::shot_active() || kcds::runtime::noclip::active();
// In the third person their view goes round the body from behind; under a held look only when
Expand Down
14 changes: 14 additions & 0 deletions Client/runtime/carts/placed_carts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,20 @@ bool local_held() {
return false;
}

bool local_climbing_off() {
const std::uint32_t own = installed ? natives.local_player() : 0;
if (own == 0) {
return false;
}
for (const auto& [id, cart] : carts) {
const int seat = seat_of(cart, own);
if (seat >= 0 && cart.climbing_off[std::size_t(seat)]) {
return true;
}
}
return false;
}

bool take_action(const char* action, unsigned mode) {
if (!action) {
return false;
Expand Down
3 changes: 3 additions & 0 deletions Client/runtime/carts/placed_carts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ void reset();
// The local player is held on a seat: only their head and view turn, the body faces the seat's way.
bool local_held();

// The local player climbs down from their seat (the clip of the way down plays).
bool local_climbing_off();

// A player's body (the local one or a replica) hangs from their cart's root entity while they sit
// on it, as the game's own wagon riders do, and lets go of it when they climb down or leave.
// Called every frame for each body.
Expand Down