Use better naming

- Remove use of Base.  It is implied if you inherit that the class inherited from is a Base.
- Fix compilation errors from said change.
This commit is contained in:
David Markowitz
2023-06-25 22:00:01 -07:00
parent 9121bf41c5
commit ec9278286b
14 changed files with 1179 additions and 1191 deletions

View File

@@ -25,7 +25,7 @@
#include "CDClientManager.h"
#include "CDSkillBehaviorTable.h"
#include "SkillComponent.h"
#include "RacingControlComponent.h"
#include "VehicleRacingControlComponent.h"
#include "RequestServerProjectileImpact.h"
#include "SyncSkill.h"
#include "StartSkill.h"
@@ -126,10 +126,8 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
std::vector<Entity*> racingControllers = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
for (Entity* racingController : racingControllers) {
auto* racingComponent = racingController->GetComponent<RacingControlComponent>();
if (racingComponent != nullptr) {
racingComponent->OnPlayerLoaded(entity);
}
auto* vehicleRacingControlComponent = racingController->GetComponent<VehicleRacingControlComponent>();
if (vehicleRacingControlComponent) vehicleRacingControlComponent->OnPlayerLoaded(entity);
}
Entity* zoneControl = EntityManager::Instance()->GetZoneControlEntity();

View File

@@ -73,7 +73,7 @@
#include "RenderComponent.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "RacingControlComponent.h"
#include "VehicleRacingControlComponent.h"
#include "RailActivatorComponent.h"
#include "LevelProgressionComponent.h"
@@ -3889,11 +3889,9 @@ void GameMessages::HandleMessageBoxResponse(RakNet::BitStream* inStream, Entity*
scriptedActivityComponent->HandleMessageBoxResponse(userEntity, GeneralUtils::UTF16ToWTF8(identifier));
}
auto* racingControlComponent = entity->GetComponent<RacingControlComponent>();
auto* vehicleRacingControlComponent = entity->GetComponent<VehicleRacingControlComponent>();
if (racingControlComponent != nullptr) {
racingControlComponent->HandleMessageBoxResponse(userEntity, iButton, GeneralUtils::UTF16ToWTF8(identifier));
}
if (vehicleRacingControlComponent) vehicleRacingControlComponent->HandleMessageBoxResponse(userEntity, iButton, GeneralUtils::UTF16ToWTF8(identifier));
for (auto* shootingGallery : EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::SHOOTING_GALLERY)) {
shootingGallery->OnMessageBoxResponse(userEntity, iButton, identifier, userData);
@@ -4137,13 +4135,11 @@ void GameMessages::HandleRacingClientReady(RakNet::BitStream* inStream, Entity*
return;
}
auto* racingControlComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent<RacingControlComponent>();
auto* vehicleRacingControlComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent<VehicleRacingControlComponent>();
if (racingControlComponent == nullptr) {
return;
}
if (!vehicleRacingControlComponent) return;
racingControlComponent->OnRacingClientReady(player);
vehicleRacingControlComponent->OnRacingClientReady(player);
}
@@ -4187,23 +4183,20 @@ void GameMessages::HandleRequestDie(RakNet::BitStream* inStream, Entity* entity,
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
auto* vehicleRacingControlComponent = zoneController->GetComponent<VehicleRacingControlComponent>();
Game::logger->Log("HandleRequestDie", "Got die request: %i", entity->GetLOT());
if (racingControlComponent != nullptr) {
auto* possessableComponent = entity->GetComponent<PossessableComponent>();
if (!vehicleRacingControlComponent) return;
auto* possessableComponent = entity->GetComponent<PossessableComponent>();
if (possessableComponent != nullptr) {
entity = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
if (possessableComponent) {
entity = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
if (entity == nullptr) {
return;
}
}
racingControlComponent->OnRequestDie(entity);
if (!entity) return;
}
vehicleRacingControlComponent->OnRequestDie(entity);
}
@@ -4230,13 +4223,11 @@ void GameMessages::HandleRacingPlayerInfoResetFinished(RakNet::BitStream* inStre
auto* zoneController = dZoneManager::Instance()->GetZoneControlObject();
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
auto* vehicleRacingControlComponent = zoneController->GetComponent<VehicleRacingControlComponent>();
Game::logger->Log("HandleRacingPlayerInfoResetFinished", "Got finished: %i", entity->GetLOT());
if (racingControlComponent != nullptr) {
racingControlComponent->OnRacingPlayerInfoResetFinished(player);
}
if (vehicleRacingControlComponent) vehicleRacingControlComponent->OnRacingPlayerInfoResetFinished(player);
}
void GameMessages::SendUpdateReputation(const LWOOBJID objectId, const int64_t reputation, const SystemAddress& sysAddr) {