generated from Persson-dev/Godot-Xmake
fixed client player going crazy on spawn
All checks were successful
Linux arm64 / Build (pull_request) Successful in 1m35s
All checks were successful
Linux arm64 / Build (pull_request) Successful in 1m35s
This commit is contained in:
@@ -20,7 +20,10 @@ using namespace godot;
|
||||
|
||||
void Player::_bind_methods() {}
|
||||
|
||||
Player::Player() : m_PeerId(0) {}
|
||||
Player::Player() : m_PeerId(0) {
|
||||
// we set the player to an invalid position
|
||||
set_position({-99999, -999999, -999999});
|
||||
}
|
||||
|
||||
Player::~Player() {}
|
||||
|
||||
@@ -31,9 +34,6 @@ void Player::_ready() {
|
||||
DEV_ASSERT(m_Mesh);
|
||||
DEV_ASSERT(m_AnimationTree);
|
||||
|
||||
set_position({0, 0, 0});
|
||||
set_velocity({0, 0, 0});
|
||||
|
||||
animate(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,4 +55,10 @@ void ServerWorld::HandlePacket(const protocol::packets::PlayerPositionAndRotatio
|
||||
SetPlayerPositionAndRotation(data.m_Player, data.m_Position, data.m_Rotation, data.m_Velocity);
|
||||
}
|
||||
|
||||
void ServerWorld::AddPlayer(PlayerID a_PlayerId, godot::String a_PlayerName) {
|
||||
World::AddPlayer(a_PlayerId, a_PlayerName);
|
||||
Player* player = GetPlayerById(a_PlayerId);
|
||||
player->set_position({0, 0, 0});
|
||||
}
|
||||
|
||||
} // namespace blitz
|
||||
Reference in New Issue
Block a user