Skip to content

Commit

Permalink
fix: compilation on BMLPlus 0.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenapte committed Sep 2, 2024
1 parent e5953f3 commit ddf14d1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions BallanceMMOClient/BallanceMMOClient.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -954,11 +954,11 @@ void BallanceMMOClient::init_commands() {

m_bml->AddTimer(CKDWORD(2), [this, position, name]() {
ExecuteBB::Unphysicalize(get_current_ball());
get_current_ball()->SetPosition(position);
get_current_ball()->SetPosition(VT21_REF(position));
CK3dEntity* camMF = m_bml->Get3dEntityByName("Cam_MF");
VxMatrix matrix = camMF->GetWorldMatrix();
m_bml->RestoreIC(camMF, true);
camMF->SetPosition(position);
camMF->SetPosition(VT21_REF(position));
camMF->SetWorldMatrix(matrix);
m_dynamicPos->ActivateInput(0);
m_dynamicPos->Activate();
Expand Down
4 changes: 2 additions & 2 deletions BallanceMMOClient/BallanceMMOClient.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ class BallanceMMOClient : public IMod, public bmmo::exported::client {
VxVector pos;
camMF->GetPosition(&pos);
m_bml->RestoreIC(camMF, true);
camMF->SetOrientation(orient[0], orient[1], orient + 2);
camMF->SetPosition(pos);
camMF->SetOrientation(VT21_REF(orient[0]), VT21_REF(orient[1]), orient + 2);
camMF->SetPosition(VT21_REF(pos));
m_dynamicPos->ActivateInput(0);
m_dynamicPos->Activate();
}
Expand Down
2 changes: 2 additions & 0 deletions BallanceMMOClient/bml_includes.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
typedef const char* BMMO_CKSTRING;
# define m_bml (m_BML)
# define m_sprite (m_Sprite)
# define VT21_REF(x) &(x) // some Virtools 2.1 pointers were changed to references in 2.5
#else
# include <BML/BMLAll.h>
# define VT21_REF(x) (x)
typedef CKSTRING BMMO_CKSTRING;
#endif
8 changes: 4 additions & 4 deletions BallanceMMOClient/game_objects.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ class game_objects {
const auto& [position, rotation] = (item.second.time_variance > MAX_EXTRAPOLATION_TIME_VARIANCE / 2)
? PlayerState::get_quadratic_extrapolated_state(tc, state_it[2], state_it[1], state_it[0])
: PlayerState::get_linear_extrapolated_state(tc, state_it[1], state_it[0]);
current_ball->SetPosition(position);
current_ball->SetQuaternion(rotation);
current_ball->SetPosition(VT21_REF(position));
current_ball->SetQuaternion(VT21_REF(rotation));
square_camera_distance = (position - camera_target_pos).SquareMagnitude();
}
else {
current_ball->SetPosition(state_it->position);
current_ball->SetQuaternion(state_it->rotation);
current_ball->SetPosition(VT21_REF(state_it->position));
current_ball->SetQuaternion(VT21_REF(state_it->rotation));
square_camera_distance = (state_it->position - camera_target_pos).SquareMagnitude();
}
}
Expand Down

0 comments on commit ddf14d1

Please sign in to comment.