From 6cd8881f1b11c99f8e72735017e743c50094e922 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Tue, 29 Oct 2024 16:19:55 +0100 Subject: Turned the PlayerRelation struct into an enum class Less code to achieve the same thing (strong type and namespaced values). The permissions related values have been moved to a PlayerPermissions struct, which is also a bit less confusing. --- src/game.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index c0624425..96935981 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -703,15 +703,15 @@ void Game::handleInput() case KeyboardConfig::KEY_TRADE: // Toggle accepting of incoming trade requests unsigned int deflt = player_relations.getDefault(); - if (deflt & PlayerRelation::TRADE) + if (deflt & PlayerPermissions::TRADE) { serverNotice(_("Ignoring incoming trade requests")); - deflt &= ~PlayerRelation::TRADE; + deflt &= ~PlayerPermissions::TRADE; } else { serverNotice(_("Accepting incoming trade requests")); - deflt |= PlayerRelation::TRADE; + deflt |= PlayerPermissions::TRADE; } player_relations.setDefault(deflt); -- cgit v1.2.3-70-g09d2