Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
This commit is contained in:
parent
35d2a8cb36
commit
a47d20f8be
890 changed files with 11796 additions and 16664 deletions
|
|
@ -1,40 +0,0 @@
|
|||
#include "Contents/NormalItemSlots.h"
|
||||
#include "Network/Connection.h"
|
||||
#include "Network/PacketLengths.h"
|
||||
#include "Network/ShortcutPacket.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
|
||||
// ORIGINAL_SITE: 0x00CFB806 in fn_21426 (fragment)
|
||||
void SendShortcutUpdate(
|
||||
CConnection& connection,
|
||||
const PacketLengths& lengths,
|
||||
int index,
|
||||
int bank,
|
||||
const NormalItemSlot* bank0,
|
||||
const NormalItemSlot* bank1,
|
||||
const NormalItemSlot* special
|
||||
) {
|
||||
unsigned char packet[13];
|
||||
const std::uint32_t header = 2849;
|
||||
std::memcpy(packet, &header, sizeof(header));
|
||||
const NormalItemSlot* slot = nullptr;
|
||||
if (index >= 36) {
|
||||
if (static_cast<unsigned>(index) - 36u <= 1) {
|
||||
slot = &special[index - 36];
|
||||
}
|
||||
} else if (bank == 0) {
|
||||
slot = &bank0[index];
|
||||
} else if (bank == 1) {
|
||||
slot = &bank1[index];
|
||||
const std::uint16_t flag = 1;
|
||||
std::memcpy(packet + 2, &flag, sizeof(flag));
|
||||
}
|
||||
if (slot) {
|
||||
std::memcpy(packet + 6, slot, sizeof(*slot));
|
||||
}
|
||||
const auto position = static_cast<std::uint16_t>(index);
|
||||
std::memcpy(packet + 4, &position, sizeof(position));
|
||||
connection.Send(lengths.FixedLength(2849), packet);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue