summaryrefslogtreecommitdiffstats
path: root/game/server
diff options
context:
space:
mode:
Diffstat (limited to 'game/server')
-rw-r--r--game/server/whitelist.cc3
-rw-r--r--game/server/world/overworld.cc4
-rw-r--r--game/server/world/universe.cc7
3 files changed, 8 insertions, 6 deletions
diff --git a/game/server/whitelist.cc b/game/server/whitelist.cc
index 053809e..f2599b9 100644
--- a/game/server/whitelist.cc
+++ b/game/server/whitelist.cc
@@ -6,6 +6,7 @@
#include "core/config/string.hh"
#include "core/io/config_map.hh"
+#include "core/io/physfs.hh"
#include "core/math/crc64.hh"
@@ -47,7 +48,7 @@ void whitelist::init_late(void)
PHYSFS_File* file = PHYSFS_openRead(whitelist::filename.c_str());
if(file == nullptr) {
- spdlog::warn("whitelist: {}: {}", whitelist::filename.get(), PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
+ spdlog::warn("whitelist: {}: {}", whitelist::filename.get(), io::physfs_error());
whitelist::enabled.set_value(false);
return;
}
diff --git a/game/server/world/overworld.cc b/game/server/world/overworld.cc
index 43059d8..b72a816 100644
--- a/game/server/world/overworld.cc
+++ b/game/server/world/overworld.cc
@@ -15,7 +15,7 @@ static void compute_tree_feature(unsigned int height, world::Feature& feature, c
const world::Voxel* leaves_voxel)
{
// Ensure the tree height is too small
- height = math::max<unsigned int>(height, 4U);
+ height = glm::max<unsigned int>(height, 4U);
// Put down a single piece of dirt
feature.push_back({ voxel_pos(0, -1, 0), game_voxels::dirt, true });
@@ -217,7 +217,7 @@ const world::Overworld_Metadata& world::Overworld::get_or_create_metadata(const
}
auto nvdi_value = 0.5f + 0.5f * fnlGetNoise2D(&m_fnl_nvdi, cpos.x, cpos.y);
- auto tree_density = (nvdi_value >= 0.33f) ? math::floor<unsigned int>(nvdi_value * 4.0f) : 0U;
+ auto tree_density = (nvdi_value >= 0.33f) ? static_cast<unsigned int>(glm::floor(nvdi_value * 4.0f)) : 0U;
for(unsigned int i = 0U; i < tree_density; ++i) {
auto lpos = local_pos((twister() % CHUNK_SIZE), (twister() % OW_NUM_TREES), (twister() % CHUNK_SIZE));
diff --git a/game/server/world/universe.cc b/game/server/world/universe.cc
index 2dd6053..b27a8de 100644
--- a/game/server/world/universe.cc
+++ b/game/server/world/universe.cc
@@ -7,6 +7,7 @@
#include "core/io/buffer.hh"
#include "core/io/config_map.hh"
+#include "core/io/physfs.hh"
#include "core/utils/epoch.hh"
@@ -51,7 +52,7 @@ static void add_new_dimension(world::Dimension* dimension)
auto dimension_dir = std::format("{}/{}", universe_name.get(), dimension->get_name());
if(!PHYSFS_mkdir(dimension_dir.c_str())) {
- spdlog::critical("universe: {}: {}", dimension_dir, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
+ spdlog::critical("universe: {}: {}", dimension_dir, io::physfs_error());
std::terminate();
}
@@ -60,7 +61,7 @@ static void add_new_dimension(world::Dimension* dimension)
metadata->zvox_dir = std::format("{}/chunk", dimension_dir);
if(!PHYSFS_mkdir(metadata->zvox_dir.c_str())) {
- spdlog::critical("universe: {}: {}", metadata->zvox_dir, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
+ spdlog::critical("universe: {}: {}", metadata->zvox_dir, io::physfs_error());
std::terminate();
}
@@ -109,7 +110,7 @@ void world::universe::init_late(void)
const auto universe_dir = std::string(universe_name.get());
if(!PHYSFS_mkdir(universe_dir.c_str())) {
- spdlog::critical("universe: {}: {}", universe_dir, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
+ spdlog::critical("universe: {}: {}", universe_dir, io::physfs_error());
std::terminate();
}