mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
chore: Simplify and move Player functionality to relevant component (#1408)
* Moving and organizing Player code - Move code to CharacterComponent - Remove extraneous interfaces - Simplify some code greatly - Change some types to return and take in const ref (only structs larger than 8 bytes benefit from this change.) - Update code to use CharacterComponent for sending to zone instead of Player*. * Moving and organizing Player code - Move code to CharacterComponent - Remove extraneous interfaces - Simplify some code greatly - Change some types to return and take in const ref (only structs larger than 8 bytes benefit from this change.) - Update code to use CharacterComponent for sending to zone instead of Player*. - Remove static storage container (static containers can be destroyed before exit/terminate handler executes) * remove player cast * Remove extra includes
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eStateChangeType.h"
|
||||
#include "eUseItemResponse.h"
|
||||
#include "Mail.h"
|
||||
|
||||
#include "CDComponentsRegistryTable.h"
|
||||
#include "CDInventoryComponentTable.h"
|
||||
@@ -264,17 +265,11 @@ void InventoryComponent::AddItem(
|
||||
}
|
||||
|
||||
if (slot == -1) {
|
||||
auto* player = dynamic_cast<Player*>(GetParent());
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
outOfSpace += size;
|
||||
|
||||
switch (sourceType) {
|
||||
case 0:
|
||||
player->SendMail(LWOOBJID_EMPTY, "Darkflame Universe", "Lost Reward", "You received an item and didn't have room for it.", lot, size);
|
||||
Mail::SendMail(LWOOBJID_EMPTY, "Darkflame Universe", m_Parent, "Lost Reward", "You received an item and didn't have room for it.", lot, size);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
Reference in New Issue
Block a user