mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-30 01:41:40 +00:00
fix: finding the player of an address with no user or character gives nothing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -33,9 +33,9 @@ bool PlayerManager::RemovePlayer(Entity* player) {
|
||||
}
|
||||
|
||||
Entity* PlayerManager::GetPlayer(const SystemAddress& sysAddr) {
|
||||
auto* entity = UserManager::Instance()->GetUser(sysAddr)->GetLastUsedChar()->GetEntity();
|
||||
|
||||
return entity;
|
||||
auto* const user = UserManager::Instance()->GetUser(sysAddr);
|
||||
auto* const character = user ? user->GetLastUsedChar() : nullptr;
|
||||
return character ? character->GetEntity() : nullptr;
|
||||
}
|
||||
|
||||
Entity* PlayerManager::GetPlayer(const std::string& name) {
|
||||
|
||||
Reference in New Issue
Block a user