Skip to content

Commit

Permalink
tweak: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Apr 7, 2022
1 parent 24d255b commit 8f0f1bc
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Code/client/Games/Skyrim/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ Inventory Actor::GetActorInventory() const noexcept
{
Inventory inventory = GetInventory();

inventory.CurrentMagicEquipment = GetEquipment();
inventory.CurrentMagicEquipment = GetMagicEquipment();

return inventory;
}

MagicEquipment Actor::GetEquipment() const noexcept
MagicEquipment Actor::GetMagicEquipment() const noexcept
{
MagicEquipment equipment;

Expand Down
2 changes: 1 addition & 1 deletion Code/client/Games/Skyrim/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ struct Actor : TESObjectREFR
float GetActorValue(uint32_t aId) const noexcept;
float GetActorMaxValue(uint32_t aId) const noexcept;
Inventory GetActorInventory() const noexcept;
MagicEquipment GetEquipment() const noexcept;
MagicEquipment GetMagicEquipment() const noexcept;

Factions GetFactions() const noexcept;
ActorValues GetEssentialActorValues() const noexcept;
Expand Down
5 changes: 0 additions & 5 deletions Code/client/Games/Skyrim/TESObjectREFR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,6 @@ void TESObjectREFR::AddOrRemoveItem(const Inventory::Entry& arEntry) noexcept
{
isWorn = pExtraDataList->Contains(ExtraData::Worn);
isWornLeft = pExtraDataList->Contains(ExtraData::WornLeft);

if (isWorn)
spdlog::error("Entry worn: {}", arEntry.ExtraWorn);
if (isWornLeft)
spdlog::critical("Entry worn left: {}", arEntry.ExtraWornLeft);
}

AddObjectToContainer(pObject, pExtraDataList, arEntry.Count, nullptr);
Expand Down
3 changes: 0 additions & 3 deletions Code/client/Services/Generic/CharacterService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ void CharacterService::OnAssignCharacter(const AssignCharacterResponse& acMessag
if (!pActor)
return;

// TODO: verify these code paths (and simplify them maybe)
if (pActor->IsDead() != acMessage.IsDead)
acMessage.IsDead ? pActor->Kill() : pActor->Respawn();

Expand Down Expand Up @@ -267,8 +266,6 @@ void CharacterService::OnAssignCharacter(const AssignCharacterResponse& acMessag

pActor->SetActorValues(acMessage.AllActorValues);

// TODO: verify this code path too while you're at it
// in fact, this whole function annoys me
if (pActor->IsDead() != acMessage.IsDead)
acMessage.IsDead ? pActor->Kill() : pActor->Respawn();

Expand Down
2 changes: 1 addition & 1 deletion Code/encoding/Messages/NotifyEquipmentChanges.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct NotifyEquipmentChanges final : ServerMessage
uint32_t ServerId{};
GameId ItemId{};
GameId EquipSlotId{};
uint32_t Count{}; // TODO: count can probably be removed
uint32_t Count{};
bool Unequip = false;
bool IsSpell = false;
bool IsShout = false;
Expand Down
2 changes: 1 addition & 1 deletion Code/encoding/Messages/RequestEquipmentChanges.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct RequestEquipmentChanges final : ClientMessage
uint32_t ServerId{};
GameId ItemId{};
GameId EquipSlotId{};
uint32_t Count{}; // TODO: count can probably be removed
uint32_t Count{};
bool Unequip = false;
bool IsSpell = false;
bool IsShout = false;
Expand Down
2 changes: 0 additions & 2 deletions Code/encoding/Structs/Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ void Inventory::UpdateEquipment(const Inventory& acNewInventory) noexcept
wornEntry->ExtraWorn = wornEntry->ExtraWornLeft = false;
}

// TODO: this is definitely not the fastest algorithm in the west
// but it'll do for now, cause tracking inventory equipment is ass
for (const auto& newEntry : acNewInventory.Entries)
{
if (!newEntry.IsWorn())
Expand Down
2 changes: 1 addition & 1 deletion Code/encoding/Structs/Inventory.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <TiltedCore/Stl.hpp>
#include "Equipment.h"
#include "MagicEquipment.h"

using TiltedPhoques::Buffer;
using TiltedPhoques::String;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <Structs/Equipment.h>
#include <Structs/MagicEquipment.h>
#include <TiltedCore/Serialization.hpp>
#include <Messages/RequestEquipmentChanges.h>

Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions Code/server/Services/InventoryService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ void InventoryService::OnEquipmentChanges(const PacketEvent<RequestEquipmentChan
{
auto& inventoryComponent = view.get<InventoryComponent>(*it);
inventoryComponent.Content.UpdateEquipment(message.CurrentInventory);
/*
spdlog::info("Updating equipment, RightHandSpell: {:X}, RightHandWeapon: {:X}, LeftHandSpell: {:X}, LeftHandWeapon: {:X}, Shout: {:X}, Ammo: {:X}",
inventoryComponent.Content.CurrentEquipment.RightHandSpell.BaseId, inventoryComponent.Content.CurrentEquipment.RightHandWeapon.BaseId,
inventoryComponent.Content.CurrentEquipment.LeftHandSpell.BaseId, inventoryComponent.Content.CurrentEquipment.LeftHandWeapon.BaseId,
inventoryComponent.Content.CurrentEquipment.Shout.BaseId, inventoryComponent.Content.CurrentEquipment.Ammo.BaseId);
*/
}

NotifyEquipmentChanges notify;
Expand Down

0 comments on commit 8f0f1bc

Please sign in to comment.