+void Game::swapOffhand()
+{
+
+ IMoveAction *a = new IMoveAction();
+ a->count = 0;
+ a->from_inv.setCurrentPlayer();
+ a->from_list = "main";
+ a->from_i = client->getEnv().getLocalPlayer()->getWieldIndex();
+ a->to_inv.setCurrentPlayer();
+ a->to_list = "offhand";
+ a->to_i = 0;
+
+ ItemStack selected;
+ client->getEnv().getLocalPlayer()->getWieldedItem(&selected, nullptr);
+
+ if (selected.name == "") {
+ auto tmp_list = a->from_list;
+ auto tmp_i = a->from_i;
+ a->from_list = a->to_list;
+ a->from_i = a->to_i;
+ a->to_list = tmp_list;
+ a->to_i = tmp_i;
+ }
+
+ client->inventoryAction(a);
+}
+
+