Tweak tool suppression logic for vehicles
This commit is contained in:
parent
5ef8aa273e
commit
be27a96505
@ -1440,7 +1440,7 @@ bool Player::canUseTool() const {
|
|||||||
bool canUse = !isDead() && !isTeleporting() && !m_techController->toolUsageSuppressed();
|
bool canUse = !isDead() && !isTeleporting() && !m_techController->toolUsageSuppressed();
|
||||||
if (canUse) {
|
if (canUse) {
|
||||||
if (auto loungeAnchor = as<LoungeAnchor>(m_movementController->entityAnchor()))
|
if (auto loungeAnchor = as<LoungeAnchor>(m_movementController->entityAnchor()))
|
||||||
if (loungeAnchor->suppressTools)
|
if (loungeAnchor->suppressTools.value(loungeAnchor->controllable))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return canUse;
|
return canUse;
|
||||||
|
@ -46,7 +46,7 @@ Vehicle::Vehicle(Json baseConfig, String path, Json dynamicConfig)
|
|||||||
loungePosition.dance.set(pair.second.optString("dance"));
|
loungePosition.dance.set(pair.second.optString("dance"));
|
||||||
loungePosition.directives.set(pair.second.optString("directives"));
|
loungePosition.directives.set(pair.second.optString("directives"));
|
||||||
loungePosition.statusEffects.set(pair.second.getArray("statusEffects", {}).transformed(jsonToPersistentStatusEffect));
|
loungePosition.statusEffects.set(pair.second.getArray("statusEffects", {}).transformed(jsonToPersistentStatusEffect));
|
||||||
loungePosition.suppressTools = pair.second.getBool("suppressTools", false);
|
loungePosition.suppressTools = pair.second.optBool("suppressTools");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto const& pair : configValue("physicsCollisions", JsonObject()).iterateObject()) {
|
for (auto const& pair : configValue("physicsCollisions", JsonObject()).iterateObject()) {
|
||||||
|
@ -96,7 +96,7 @@ private:
|
|||||||
Maybe<Vec2F> exitBottomOffset;
|
Maybe<Vec2F> exitBottomOffset;
|
||||||
JsonObject armorCosmeticOverrides;
|
JsonObject armorCosmeticOverrides;
|
||||||
Maybe<String> cursorOverride;
|
Maybe<String> cursorOverride;
|
||||||
bool suppressTools;
|
Maybe<bool> suppressTools;
|
||||||
bool cameraFocus;
|
bool cameraFocus;
|
||||||
|
|
||||||
NetElementBool enabled;
|
NetElementBool enabled;
|
||||||
|
@ -31,7 +31,7 @@ struct LoungeAnchor : EntityAnchor {
|
|||||||
Maybe<Directives> directives;
|
Maybe<Directives> directives;
|
||||||
JsonObject armorCosmeticOverrides;
|
JsonObject armorCosmeticOverrides;
|
||||||
Maybe<String> cursorOverride;
|
Maybe<String> cursorOverride;
|
||||||
bool suppressTools;
|
Maybe<bool> suppressTools;
|
||||||
bool cameraFocus;
|
bool cameraFocus;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user