Skip to content

improve : quickLoot features#1096

Merged
mehah merged 7 commits intoopentibiabr:mainfrom
kokekanon:improve-quickloot
Feb 15, 2025
Merged

improve : quickLoot features#1096
mehah merged 7 commits intoopentibiabr:mainfrom
kokekanon:improve-quickloot

Conversation

@kokekanon
Copy link
Copy Markdown
Contributor

@kokekanon kokekanon commented Feb 6, 2025

Description

image
image

server 1340

void ProtocolGame::parseQuickLoot(NetworkMessage &msg) {
	if (oldProtocol) {
		return;
	}

	uint8_t variant = msg.getByte();
	const Position pos = msg.getPosition();
	auto itemId = 0;
	uint8_t stackpos = 0;
	bool lootAllCorpses = true;
	bool autoLoot = true;

	if (variant == 2) {
		// Loot player nearby (13.40)
	} else {
		itemId = msg.get<uint16_t>();
		stackpos = msg.getByte();
		lootAllCorpses = variant == 1;
		autoLoot = false;
	}
	g_logger().debug("[{}] variant {}, pos {}, itemId {}, stackPos {}", __FUNCTION__, variant, pos.toString(), itemId, stackpos);
	g_game().playerQuickLoot(player->getID(), pos, itemId, stackpos, nullptr, lootAllCorpses, autoLoot);
}

Behavior

Actual

Do this and that doesn't happens

Expected

g_game.sendQuickLoot(1, useThing)
cipsoft:

[2025-05-02 21:22:29.471] [warning] [ProtocolGame::parseQuickLoot] variant 1, pos ( 32368, 32216, 7 ), itemId 4026, stackPos 2

otcr:

[2025-05-02 21:22:14.558] [warning] [ProtocolGame::parseQuickLoot] variant 1, pos ( 32368, 32216, 7 ), itemId 4026, stackPos 2

g_game.sendQuickLoot(2)
cipsoft:

[2025-05-02 21:15:35.686] [warning] [ProtocolGame::parseQuickLoot] variant 2, pos ( 0, 0, 0 ), itemId 0, stackPos 0

otcr:

[2025-05-02 21:15:30.596] [warning] [ProtocolGame::parseQuickLoot] variant 2, pos ( 0, 0, 0 ), itemId 0, stackPos 0

Fixes

request for a user on discord

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested

Test Configuration:

  • Server Version:13.40
  • Client: this pr
  • Operating System: win 11

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@kokekanon kokekanon marked this pull request as ready for review February 14, 2025 21:04
@sonarqubecloud
Copy link
Copy Markdown

@mehah mehah merged commit 8288c1b into opentibiabr:main Feb 15, 2025
12 checks passed
vllsystems pushed a commit to vllsystems/otclient that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants