Skip to content

Commit 1944362

Browse files
committed
Removed not used variable.
1 parent cab3761 commit 1944362

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

core/peer_networked_controller.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,8 +1513,6 @@ void DollController::process(double p_delta) {
15131513

15141514
void DollController::on_state_validated(FrameIndex p_frame_index, bool p_detected_desync) {
15151515
notify_frame_checked(last_doll_compared_input);
1516-
is_last_doll_compared_input_valid = false;
1517-
last_doll_compared_input = FrameIndex::NONE;
15181516
}
15191517

15201518
void DollController::notify_frame_checked(FrameIndex p_doll_frame_index) {
@@ -1650,7 +1648,7 @@ void DollController::copy_controlled_objects_snapshot(
16501648
is_doll_snap_A_older);
16511649
}
16521650

1653-
FrameIndex DollController::fetch_last_processed_recoverable_snapshot(DollSnapshot *&r_client_snapshot, DollSnapshot *&r_server_snapshot) {
1651+
FrameIndex DollController::fetch_checkable_snapshot(DollSnapshot *&r_client_snapshot, DollSnapshot *&r_server_snapshot) {
16541652
for (auto client_snap_it = client_snapshots.rbegin(); client_snap_it != client_snapshots.rend(); client_snap_it++) {
16551653
if (client_snap_it->doll_executed_input != FrameIndex::NONE) {
16561654
auto server_snap_it = VecFunc::find(server_snapshots, client_snap_it->doll_executed_input);
@@ -1695,15 +1693,13 @@ bool DollController::__pcr__fetch_recovery_info(
16951693
DollSnapshot *server_snapshot;
16961694

16971695
// This is valid until we reset it again.
1698-
is_last_doll_compared_input_valid = true;
1699-
last_doll_compared_input = fetch_last_processed_recoverable_snapshot(client_snapshot, server_snapshot);
1700-
1701-
if (last_doll_compared_input == FrameIndex::NONE) {
1696+
const FrameIndex checkable_input = fetch_checkable_snapshot(client_snapshot, server_snapshot);
1697+
if (checkable_input == FrameIndex::NONE) {
17021698
// Nothing to check.
17031699
return true;
17041700
}
17051701

1706-
last_doll_compared_input = client_snapshot->doll_executed_input;
1702+
last_doll_compared_input = checkable_input;
17071703

17081704
// Now just compare the two snapshots.
17091705
return Snapshot::compare(

core/peer_networked_controller.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,6 @@ struct DollController final : public RemotelyControlledController {
385385

386386
// The lastest `FrameIndex` validated.
387387
FrameIndex last_doll_validated_input = FrameIndex::NONE;
388-
// This parameter is useful to specify when the `last_doll_compared_snapshot`
389-
// is set. Since the function `__pcr__fetch_recovery_info` is not always called.
390-
bool is_last_doll_compared_input_valid = false;
391388
// The lastest `FrameIndex` on which the server / doll snapshots were compared.
392389
FrameIndex last_doll_compared_input = FrameIndex::NONE;
393390
FrameIndex queued_frame_index_to_process = FrameIndex{ 0 };
@@ -418,7 +415,7 @@ struct DollController final : public RemotelyControlledController {
418415
std::vector<DollSnapshot> &r_snapshots,
419416
bool p_store_even_when_doll_is_not_processing);
420417

421-
FrameIndex fetch_last_processed_recoverable_snapshot(DollSnapshot *&r_client_snapshot, DollSnapshot *&r_server_snapshot);
418+
FrameIndex fetch_checkable_snapshot(DollSnapshot *&r_client_snapshot, DollSnapshot *&r_server_snapshot);
422419

423420
// Checks whether this doll requires a reconciliation.
424421
// The check done is relative to the doll timeline, and not the scene sync timeline.

0 commit comments

Comments
 (0)