mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-14 03:19:56 +00:00
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)
This commit is contained in:
@@ -461,8 +461,9 @@ void SGCannon::RemovePlayer(LWOOBJID playerID) {
|
||||
return;
|
||||
|
||||
auto* character = playerObject->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
playerObject->SendToZone(character->GetLastNonInstanceZoneID());
|
||||
auto* characterComponent = playerObject->GetComponent<CharacterComponent>();
|
||||
if (characterComponent && character) {
|
||||
characterComponent->SendToZone(character->GetLastNonInstanceZoneID());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user