Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game
diff options
context:
space:
mode:
Diffstat (limited to 'source/game')
-rw-r--r--source/game/StarPlayer.cpp2
-rw-r--r--source/game/StarRoot.cpp5
-rw-r--r--source/game/StarRoot.hpp2
-rw-r--r--source/game/StarStatusController.cpp5
4 files changed, 12 insertions, 2 deletions
diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp
index c094bbb..af85cce 100644
--- a/source/game/StarPlayer.cpp
+++ b/source/game/StarPlayer.cpp
@@ -1086,7 +1086,7 @@ void Player::update(float dt, uint64_t) {
}
if (calculateHeadRotation) { // master or not an OpenStarbound player
float headRotation = 0.f;
- if (m_humanoid->primaryHandHoldingItem() || m_humanoid->altHandHoldingItem() || m_humanoid->dance()) {
+ if (Humanoid::globalHeadRotation() && (m_humanoid->primaryHandHoldingItem() || m_humanoid->altHandHoldingItem() || m_humanoid->dance())) {
auto primary = m_tools->primaryHandItem();
auto alt = m_tools->altHandItem();
String const disableFlag = "disableHeadRotation";
diff --git a/source/game/StarRoot.cpp b/source/game/StarRoot.cpp
index fbf818f..e429646 100644
--- a/source/game/StarRoot.cpp
+++ b/source/game/StarRoot.cpp
@@ -371,6 +371,11 @@ void Root::registerReloadListener(ListenerWeakPtr reloadListener) {
m_reloadListeners.addListener(std::move(reloadListener));
}
+void Root::hotReload() {
+ assets()->hotReload();
+ m_reloadListeners.trigger();
+}
+
String Root::toStoragePath(String const& path) const {
return File::relativeTo(m_settings.storageDirectory, File::convertDirSeparators(path));
}
diff --git a/source/game/StarRoot.hpp b/source/game/StarRoot.hpp
index 2079a5e..4659488 100644
--- a/source/game/StarRoot.hpp
+++ b/source/game/StarRoot.hpp
@@ -131,6 +131,8 @@ public:
// the internal listener list.
void registerReloadListener(ListenerWeakPtr reloadListener);
+ void hotReload();
+
// Translates the given path to be relative to the configured storage
// location.
String toStoragePath(String const& path) const;
diff --git a/source/game/StarStatusController.cpp b/source/game/StarStatusController.cpp
index 26c83d0..d6635b6 100644
--- a/source/game/StarStatusController.cpp
+++ b/source/game/StarStatusController.cpp
@@ -132,7 +132,10 @@ Json StatusController::statusProperty(String const& name, Json const& def) const
}
void StatusController::setStatusProperty(String const& name, Json value) {
- m_statusProperties.set(name, value);
+ if (value.isNull())
+ m_statusProperties.remove(name);
+ else
+ m_statusProperties.set(name, value);
}
StringList StatusController::statNames() const {