Fixed #125.
This commit is contained in:
parent
dc4140074d
commit
7981c4525d
@ -84,7 +84,7 @@ class ClientWorld : public World, public gk::Drawable {
|
||||
ClientCommandHandler *m_client = nullptr;
|
||||
gk::Camera *m_camera = nullptr;
|
||||
|
||||
mutable gk::Vector4f m_closestInitializedChunk{0, 0, 0, 1000000};
|
||||
mutable gk::Vector4d m_closestInitializedChunk{0, 0, 0, 1000000};
|
||||
|
||||
const Sky *m_sky = nullptr;
|
||||
};
|
||||
|
@ -74,9 +74,9 @@ class Player : public gk::ISerializable {
|
||||
|
||||
u16 m_dimension = 0;
|
||||
|
||||
float m_viewAngleH;
|
||||
float m_viewAngleV;
|
||||
float m_viewAngleRoll;
|
||||
float m_viewAngleH = 0;
|
||||
float m_viewAngleV = 0;
|
||||
float m_viewAngleRoll = 0;
|
||||
|
||||
u16 m_clientID = 0;
|
||||
|
||||
|
@ -75,15 +75,20 @@ void ChatCommandHandler::teleportationCommand(const std::vector<std::string> &co
|
||||
m_server.sendChatMessage(0, "Usage: /tp x y z", &client);
|
||||
}
|
||||
else {
|
||||
s32 x = std::stoi(command.at(1));
|
||||
s32 y = std::stoi(command.at(2));
|
||||
s32 z = std::stoi(command.at(3));
|
||||
try {
|
||||
s32 x = std::stoi(command.at(1));
|
||||
s32 y = std::stoi(command.at(2));
|
||||
s32 z = std::stoi(command.at(3));
|
||||
|
||||
m_server.setPlayerPosition(client.id, x, y, z);
|
||||
m_server.setPlayerPosition(client.id, x, y, z);
|
||||
|
||||
m_server.sendPlayerPosUpdate(client.id, true);
|
||||
m_server.sendPlayerPosUpdate(client.id, true);
|
||||
|
||||
m_server.sendChatMessage(0, "Teleported to " + std::to_string(x) + " " + std::to_string(y) + " " + std::to_string(z), &client);
|
||||
m_server.sendChatMessage(0, "Teleported to " + std::to_string(x) + " " + std::to_string(y) + " " + std::to_string(z), &client);
|
||||
}
|
||||
catch (std::out_of_range &e) {
|
||||
m_server.sendChatMessage(0, "Invalid coordinates", &client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ void ServerWorld::sendChunkData(const ClientInfo &client, ServerChunk &chunk) {
|
||||
chunk.setSent(true);
|
||||
chunk.setChanged(false);
|
||||
|
||||
// std::cout << "Chunk at (" << chunk->x() << ", " << chunk->y() << ", " << chunk->z() << ") sent to client" << std::endl;
|
||||
// std::cout << "Chunk at (" << chunk.x() << ", " << chunk.y() << ", " << chunk.z() << ") sent to client" << std::endl;
|
||||
}
|
||||
|
||||
void ServerWorld::sendRequestedData(ClientInfo &client, int cx, int cy, int cz) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user