mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-07 03:04:05 +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:
@@ -20,6 +20,7 @@
|
||||
#include "InventoryComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eObjectBits.h"
|
||||
#include "CharacterComponent.h"
|
||||
|
||||
#include <vector>
|
||||
#include "CppScripts.h"
|
||||
@@ -247,7 +248,8 @@ void PropertyManagementComponent::OnStartBuilding() {
|
||||
for (auto* player : players) {
|
||||
if (player == ownerEntity) continue;
|
||||
|
||||
player->SendToZone(zoneId);
|
||||
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||
if (characterComponent) characterComponent->SendToZone(zoneId);
|
||||
}
|
||||
auto inventoryComponent = ownerEntity->GetComponent<InventoryComponent>();
|
||||
|
||||
|
Reference in New Issue
Block a user