Changes related to 'SetPossessedTangible'
This commit is contained in:
@@ -35,6 +35,7 @@ UClass *UlxTangibleManager::GetTangibleClass(const FString &name) {
|
||||
|
||||
UlxTangibleManager::UlxTangibleManager() {
|
||||
World = nullptr;
|
||||
PossessedTangible = nullptr;
|
||||
}
|
||||
|
||||
void UlxTangibleManager::Init(UWorld* world, AIntegrationGameModeBase *gamemode) {
|
||||
@@ -53,6 +54,7 @@ UlxTangible* UlxTangibleManager::GetTangible(int64 id) const {
|
||||
|
||||
#pragma optimize("", off)
|
||||
UlxTangible* UlxTangibleManager::MakeTangible(int64 id) {
|
||||
check(id > 0);
|
||||
UlxTangible*& t = IdToTangible.FindOrAdd(id);
|
||||
if (t == nullptr) {
|
||||
t = NewObject<UlxTangible>();
|
||||
@@ -75,6 +77,19 @@ TanArray UlxTangibleManager::GetAllTangibles() const {
|
||||
return result;
|
||||
}
|
||||
|
||||
UlxTangible *UlxTangibleManager::SetPossessedTangible(int64 id) {
|
||||
UlxTangible *t = GetTangible(id);
|
||||
if ((t == nullptr) || (t->GetActor() == nullptr)) {
|
||||
PossessedTangible = nullptr;
|
||||
return nullptr;
|
||||
} else if (t == PossessedTangible) {
|
||||
return nullptr;
|
||||
} else {
|
||||
PossessedTangible = t;
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma optimize("", off)
|
||||
void UlxTangibleManager::UpdateNearAccordingToLuprex(IdView near) {
|
||||
// Clear all the 'NearAccordingToLuprex' flags.
|
||||
|
||||
Reference in New Issue
Block a user