A Bunch of miscellaneous refactoring
This commit is contained in:
@@ -143,13 +143,22 @@ void AIntegrationGameModeBase::UpdateTangibles() {
|
||||
}
|
||||
|
||||
void AIntegrationGameModeBase::UpdatePossessedTangible() {
|
||||
bool updated = TangibleManager->SetPossessedTangible(PlayerId);
|
||||
if (updated) {
|
||||
UlxTangible *ptan = TangibleManager->GetPossessedTangible();
|
||||
UlxTangible *ptan = TangibleManager->GetPossessedTangible();
|
||||
UlxTangible *tan = TangibleManager->GetTangible(PlayerId);
|
||||
APlayerController *ctrl = GetWorld()->GetFirstPlayerController();
|
||||
APawn *pawn = nullptr;
|
||||
if (tan != nullptr) pawn = Cast<APawn>(tan->GetActor());
|
||||
if (pawn == nullptr) {
|
||||
if (ptan != nullptr) {
|
||||
IlxTangibleInterface::Execute_BecomePossessed(ptan->GetActor());
|
||||
TangibleManager->SetPossessedTangible(nullptr);
|
||||
ctrl->Possess(nullptr);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ptan != tan) {
|
||||
TangibleManager->SetPossessedTangible(tan);
|
||||
ctrl->Possess(pawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AIntegrationGameModeBase::LuaCallEnd(InvocationKind kind, int64 place_id) {
|
||||
|
||||
Reference in New Issue
Block a user