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();
|
||||
if (canUse) {
|
||||
if (auto loungeAnchor = as<LoungeAnchor>(m_movementController->entityAnchor()))
|
||||
if (loungeAnchor->suppressTools)
|
||||
if (loungeAnchor->suppressTools.value(loungeAnchor->controllable))
|
||||
return false;
|
||||
}
|
||||
return canUse;
|
||||
|
@ -46,7 +46,7 @@ Vehicle::Vehicle(Json baseConfig, String path, Json dynamicConfig)
|
||||
loungePosition.dance.set(pair.second.optString("dance"));
|
||||
loungePosition.directives.set(pair.second.optString("directives"));
|
||||
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()) {
|
||||
|
@ -96,7 +96,7 @@ private:
|
||||
Maybe<Vec2F> exitBottomOffset;
|
||||
JsonObject armorCosmeticOverrides;
|
||||
Maybe<String> cursorOverride;
|
||||
bool suppressTools;
|
||||
Maybe<bool> suppressTools;
|
||||
bool cameraFocus;
|
||||
|
||||
NetElementBool enabled;
|
||||
|
@ -31,7 +31,7 @@ struct LoungeAnchor : EntityAnchor {
|
||||
Maybe<Directives> directives;
|
||||
JsonObject armorCosmeticOverrides;
|
||||
Maybe<String> cursorOverride;
|
||||
bool suppressTools;
|
||||
Maybe<bool> suppressTools;
|
||||
bool cameraFocus;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user